I need to make the sound sound once, and not repeat in a loop , sound for gear , the problem is why this is bucle
_______________________________________________________________________________________________-
g_player = getLocalPlayer()
g_root = getRootElement()
function CurrentGear()
g_vehicle = getPedOccupiedVehicle(g_player)
if g_vehicle then
gear = getVehicleCurrentGear(g_vehicle)
if (gear == 2) then
local sound = playSound("sounds/bov.wav",false)
setSoundVolume(sound, 0.5)
end
else
return
end
end
addEventHandler("onClientRender",g_root,CurrentGear)