rusztamas Posted April 1, 2017 Share Posted April 1, 2017 Hi! I want to make a death script to my server. It should do this: -when you die, sets your camera matrix to you, from the sky -starts playing a 2m music -sets timer to 2m, -after 2m timer, you should respawn ...but i get errors. Script: serverside: function halal() local halottX, halottY, halottZ = getElementPosition(source) setCameraMatrix (source, halottX, halottY, halottZ+15, halottX, halottY, halottZ) triggerClientEvent ("startHalalMusic", source) triggerEvent ("ujraeledes", source) end addEventHandler ("onPlayerWasted", getRootElement(), halal) function ujraeledes() local varjalMar = setTimer( function() spawnPlayer (source, 0, 0, 0) setCameraTarget (source, source) fadeCamera (source, true) triggerClientEvent ("stopHalalMusic", source) end end, 120000, 1 ) addEvent ("ujraeledes", true) addEventHandler ("ujraeledes", getRootElement(), ujraeledes) Clientside: function startHalalMusic() local halalMusic = playSound ("assets/death.mp3") end addEvent("startHalalMusic", true) addEventHandler("startHalalMusic", getRootElement(), startHalalMusic) function stopHalalMusic() stopSound (halalMusic) end addEvent("stopHalalMusic", true) addEventHandler("stopHalalMusic", getRootElement(), stopHalalMusic) koth\koth.codeS_Death.lua:16: ')' expected (to close '(' at line 10) near 'end' Please help. Link to comment
NeXuS™ Posted April 1, 2017 Share Posted April 1, 2017 function ujraeledes() local varjalMar = setTimer( function() spawnPlayer (source, 0, 0, 0) setCameraTarget (source, source) fadeCamera (source, true) triggerClientEvent ("stopHalalMusic", source) end, 120000, 1) end) 1 Link to comment
rusztamas Posted April 1, 2017 Author Share Posted April 1, 2017 SCRIPT ERROR: koth\koth.codeS_Death.lua:18: unexpected symbol near ')' function 'ujraeledes' is from line 9 to 18. Link to comment
NeXuS™ Posted April 1, 2017 Share Posted April 1, 2017 function ujraeledes() local varjalMar = setTimer( function() spawnPlayer (source, 0, 0, 0) setCameraTarget (source, source) fadeCamera (source, true) triggerClientEvent ("stopHalalMusic", source) end, 120000, 1) end 1 Link to comment
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