Ulysses
General => Developers Corner => Topic started by: BlackSanta on August 02, 2013, 08:41:45 PM
-
Hi,
I have made a script that plays a sound using ULX playsound when 2 players are left alive. However, it does not play the sound. There are no LUA errors, everything is where its supposed to be. I just don't know whats wrong. Anybody out there that can help me?
Here is the script:
function checkAlive(ply)
if ply:Alive(2) then //Returns Boolean
duel()
end
function duel()
RunConsoleCommand( "ulx", "playsound", "1v1.mp3" )
end
end
Thanks guys.
-
Any errors in server or client consoles?
-
None at all, thats whats confusing me.
-
Do you have anything that actually calls CheckAlive?
-
Hmmm, I do not believe I do, let me try fixing it and get back to you.
-
Hmm, not exactly sure if what I did was right or not, but it still is not working.
Here is the current code:
function checkAlive(ply)
hook.Call( "checkAlive" )
if ply:Alive(2) then //Returns Boolean
duel()
end
function duel()
BroadcastLua('surface.PlaySound("1v1.mp3")')
end
end
-
I suspect you're just attempting to hack something together without really understanding the language. Look at the stickies for help getting started with Lua.