|
Returns
|
ClientSound
|
|
Prototype
|
ClientSound.Create(AssetLocation, table)
|
|
Description
|
No description
|
Required values
| Type |
Name |
Notes |
| Vector3 |
position |
|
| number |
bank_id |
|
| number |
sound_id |
|
Optional values
| Type |
Name |
Notes |
| number |
variable_id_distance |
|
| number |
variable_id_focus |
|
| number |
variable_id_rain |
|
| number |
variable_id_time_of_day |
|
| number |
variable_id_timeline |
|
Example
Create the Mile High Club music where you click
sound = nil
Events:Subscribe("MouseDown", function(args)
if args.button ~= 1 then
return
end
Chat:Print("Creating sound", Color.White)
CleanUp()
local result = Physics:Raycast(
Camera:GetPosition(),
Camera:GetAngle() * Vector3.Forward,
0,
100
)
local spawnArgs = {
position = result.position + result.normal * 0.5,
bank_id = 25,
sound_id = 148,
variable_id_focus = 0,
}
sound = ClientSound.Create(AssetLocation.Game, spawnArgs)
end)
function CleanUp()
if sound then
sound:Remove()
sound = nil
end
end
Events:Subscribe("ModuleUnload", CleanUp)
External links