Playing a sound in Prophunt when hunters are almost unblinded..
1 replies, posted
Im trying to get it so when the hunters are about to be unblinded, the "air-raid" wave file plays and a message pops up warning the props that they are running out of time... But it doesn't seem to work..
The bold section is the code i added
Here's what i have
[QUOTE]
function CLASS:OnSpawn(pl)
local unlock_time = math.Clamp(HUNTER_BLINDLOCK_TIME - (CurTime() - GetGlobalFloat("RoundStartTime", 0)), 0, HUNTER_BLINDLOCK_TIME)
//function MyLockFunc()
//function MyUnlockFunc()
local unblindfunc = function()
//MyUnblindFunc(pl.Blind(false))
pl:Blind(false)
end
local lockfunc = function()
//MyLockFunc(pl.Lock())
pl.Lock(pl)
end
local unlockfunc = function()
//MyUnlockFunc(pl.UnLock())
pl.UnLock(pl)
end
[B] if unlock_time < 10 then
surface.PlaySound( "air-raid.wav" )
PrintMessage( HUD_PRINTTALK, "WARNING! HUNTERS ARE ABOUT TO BE RELEASED" )
end[/B]
if unlock_time > 2 then
pl:Blind(true)
timer.Simple(unlock_time, unblindfunc)
timer.Simple(2, lockfunc)
timer.Simple(unlock_time, unlockfunc)
end
end
[/QUOTE]
Should it work? or have i done something wrong?
No, surface.PlaySound is a client function and you are running it on the server, you either need to network the function or use a different method of delivering the sound.
Sorry, you need to Log In to post a reply to this thread.