I'm new to Lua and am trying to get a sound to stop. I looked at the Wiki and saw the stopSound.
Well the music does not stop and am getting an error:
bad argument at 'stopSound' expected sound at argument 1
addEventHandler ( "onClientClick", getRootElement(), results_click)
addEventHandler("onClientRender", getRootElement(), score_render)
setTimer(function()
results_d.enter = 'Press Enter To Hide'
results_d.res_dx.close[1] = (screenWidth - dxGetTextWidth ( results_d.enter, results_d.res_dx.size1, "bankgothic" ))/2
bindKey ( "enter", "up", HideResultsT )
end,4000,1)
stopSound ( cds )
end
That's where it stops it at. But it's saying unknown sound.
It's clearly defined here:
addEventHandler("DestroyRoundTimer", getRootElement(), DestroyRoundTimer)
G_hud = "0:0"
local s_1_00 = false
function getTimeFromMilisec(t)
local f = (t/1000)/60
m = math.modf(f)
s = math.modf((f-m)*60)
G_hud = FormatTimer(m,s)
if s == 0 then
if m == 1 and s_1_00 == false then
s_1_00 = true
cds = playSound("sounds/alarm.ogg",false)
setSoundVolume( cds,0.6)
end
end
end
am i missing something?