Pretty straight forward. I'm trying to make a code that plays a sound when someone enters my server. I've tried lots of different codes, but they don't work. Any help is appreciated.
Can't you use GM:Playerinitialspawn? and use ent:emitsound?(Assuming you can emit from yourself?)
[QUOTE=mil0001;35476449]Can't you use GM:Playerinitialspawn? and use ent:emitsound?(Assuming you can emit from yourself?)[/QUOTE]
wouldn't it be ply:emitsound, since you're a player?
Nevermind, I've figured it out. Thank you.
Player Initial spawn won't work for playing sounds. It starts playing the sound right as you connect to the server, not once you get in game.
[lua]
hook.Add("PlayerConnect","Spawning",function(ply)
for k,v in pairs(player.GetAll()) do
if v:IsAdmin() then //just the admin sound
v:EmitSound("vo/achievement.wav")
end
end)
[/lua]
:D
if you want the person who just joined to hear it then trigger it with a console command
[QUOTE=Senor_Penguin;35480682]Player Initial spawn won't work for playing sounds. It starts playing the sound right as you connect to the server, not once you get in game.[/QUOTE]
Try OnEntityCreated(ent) and use ent:IsPlayer
Sorry, you need to Log In to post a reply to this thread.