play_sound path issues
Posted: Tue Nov 06, 2018 9:59 am
Hi there!
So I'm kinda new to modding this game and recently my friends and I stumbled upon this mod called TrainHorn by Benjamin Lee.
It plays a sound to the player who died by a train, but we want it to be played globally.
Right now I've got this bit of code running and when there's a known ambient sound it doesn't seem to cause an issue.
However, when we change it to "ambient/horn.ogg" it gives an unknown sound error.
Does anyone know how to make the horn sound a known ambient sound?
I thank you all in advance!
- Theelicht
So I'm kinda new to modding this game and recently my friends and I stumbled upon this mod called TrainHorn by Benjamin Lee.
It plays a sound to the player who died by a train, but we want it to be played globally.
Code: Select all
script.on_event(defines.events.on_player_died, function(event)
if event.cause ~= nil then
if event.cause.type == 'locomotive' then
for index,player in pairs(game.connected_players) do
player.play_sound{path="ambient/horn.ogg", position = player.position}
end
end
end
end)
However, when we change it to "ambient/horn.ogg" it gives an unknown sound error.
Does anyone know how to make the horn sound a known ambient sound?
I thank you all in advance!
- Theelicht