Normand Posted June 11, 2017 Posted June 11, 2017 I have a air raid siren script, but when i start that, my friends can't hear that.
aka Blue Posted June 11, 2017 Posted June 11, 2017 You need to do it serverside and trigger root to client to play sound for all players.
Normand Posted June 12, 2017 Author Posted June 12, 2017 How to trigger root to client? Sorry for my bad english.
Hale Posted June 12, 2017 Posted June 12, 2017 triggerClientEvent("eventname", root, ...) ... is for arguments (if any)
Normand Posted June 12, 2017 Author Posted June 12, 2017 (edited) Ohh, :~, What?! I don't understand it, sorry. Please fix it for all player, please. Code: Client: function szirenak() sound = playSound("szirena.mp3") end addEvent("SzirenaLejatszasa", true) addEventHandler("SzirenaLejatszasa", root, szirenak) Server: function Szirena(player, command) triggerClientEvent(player, "SzirenaLejatszasa", player) end addCommandHandler("szirena", Szirena) Edited June 12, 2017 by Normand problem
MIKI785 Posted June 12, 2017 Posted June 12, 2017 function Szirena(player, command) triggerClientEvent(root, "SzirenaLejatszasa", player) end addCommandHandler("szirena", Szirena) It should look like that, the first argument to triggerClientEvent is the players it's gonna trigger for, root is everyone.
Ahmed Ly Posted June 12, 2017 Posted June 12, 2017 --Client function szirenak() if isElement(sound) then stopSound(sound) end sound = playSound("szirena.mp3") end addEvent("SzirenaLejatszasa", true) addEventHandler("SzirenaLejatszasa", root, szirenak) -- Server function Szirena(player, command) triggerClientEvent("SzirenaLejatszasa",root) end addCommandHandler("szirena", Szirena)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now