Hi, I'm a real newbie in LUA script, and doing "something", I checked it but it doesn't work.
The idea is to play a song (Which is played) and then pressing "space", the song stops.
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function()
setTimer(function()
playSound("winsound.mp3")
end, 2000, 1)
end
)
function stopMusic(player, key, keyState)
if(keyState == "down") then
stopSound("winsound.mp3")
end
end
function bindTheKeys(player, commandName)
bindKey(player, "space", "down", stopMusic)
end