Show raw api
{
"functions": [
{
"name": "Band",
"desc": "Pure.",
"params": [
{
"name": "bands",
"desc": "",
"lua_type": "{ NoiseBand }"
},
{
"name": "speed",
"desc": "",
"lua_type": "number"
}
],
"returns": [
{
"desc": "The fastest band whose `Speed` is at or below `speed`, or `nil`.",
"lua_type": "NoiseBand?"
}
],
"function_type": "static",
"source": {
"line": 92,
"path": "lib/World/PlayerNoise.luau"
}
},
{
"name": "LoudnessOf",
"desc": "A band's loudness for this speed and character: the number, or what the function returns.\n`0`, a negative or a non-number is `nil`, so the caller fires nothing. Pure.",
"params": [
{
"name": "band",
"desc": "",
"lua_type": "NoiseBand"
},
{
"name": "speed",
"desc": "",
"lua_type": "number"
},
{
"name": "character",
"desc": "",
"lua_type": "Model"
}
],
"returns": [
{
"desc": "The loudness to fire, or `nil` for no noise.",
"lua_type": "number?"
}
],
"function_type": "static",
"source": {
"line": 112,
"path": "lib/World/PlayerNoise.luau"
}
},
{
"name": "new",
"desc": "Starts listening on the server. Destroy it to stop.",
"params": [
{
"name": "signal",
"desc": "The signal your Hearing senses listen to.",
"lua_type": "Signal<(Vector3, number?, string?)>"
},
{
"name": "bands",
"desc": "",
"lua_type": "{ NoiseBand }"
},
{
"name": "options",
"desc": "",
"lua_type": "PlayerNoiseOptions?"
}
],
"returns": [
{
"desc": "",
"lua_type": "PlayerNoise"
}
],
"function_type": "static",
"errors": [
{
"lua_type": "\"bands need Speed, Every and Loudness\"",
"desc": ""
},
{
"lua_type": "\"unknown option\"",
"desc": ""
}
],
"source": {
"line": 132,
"path": "lib/World/PlayerNoise.luau"
}
},
{
"name": "Destroy",
"desc": "Stops listening.",
"params": [
{
"name": "self",
"desc": "",
"lua_type": "PlayerNoise"
}
],
"returns": [],
"function_type": "static",
"source": {
"line": 185,
"path": "lib/World/PlayerNoise.luau"
}
}
],
"properties": [],
"types": [
{
"name": "NoiseBand",
"desc": "",
"fields": [
{
"name": "Speed",
"lua_type": "number",
"desc": "Studs per second at or above which this band applies. The fastest band a player reaches wins."
},
{
"name": "Every",
"lua_type": "number",
"desc": "Seconds between noises while in this band."
},
{
"name": "Loudness",
"lua_type": "number | (speed: number, character: Model) -> number?",
"desc": "Passed to the signal; a [Hearing] with `Range` hears it from `Range * Loudness` studs. A function is asked on every noise; `nil` or `0` makes none (a crouch off an attribute)."
},
{
"name": "Kind",
"lua_type": "string?",
"desc": "Passed as the third argument, written as `HeardKind` by [Hearing]."
}
],
"source": {
"line": 36,
"path": "lib/World/PlayerNoise.luau"
}
},
{
"name": "PlayerNoiseOptions",
"desc": "",
"fields": [
{
"name": "RootName",
"lua_type": "string?",
"desc": "The part under each character whose velocity and position are read. Default `\"HumanoidRootPart\"`."
}
],
"source": {
"line": 49,
"path": "lib/World/PlayerNoise.luau"
}
}
],
"name": "PlayerNoise",
"desc": "Players make noise by moving. Give it the noise signal your [Hearing] senses listen to and the\nspeed bands; while a player moves at a band's speed or faster, a noise of that band is fired at\ntheir feet every `Every` seconds, with their character as the source. Standing still, or moving\nbelow the slowest band, is silent.\n\n```lua\nlocal function step(loudness)\n\treturn function(_speed, character)\n\t\treturn if character:GetAttribute(\"Crouching\") then nil else loudness\n\tend\nend\n\nVluxyAI.PlayerNoise.new(noises, {\n\t{ Speed = 4, Every = 0.7, Loudness = step(0.25), Kind = \"Footstep\" }, -- walking, silent crouched\n\t{ Speed = 19, Every = 0.5, Loudness = 0.6, Kind = \"Running\" }, -- sprinting\n})\n```",
"source": {
"line": 83,
"path": "lib/World/PlayerNoise.luau"
}
}