• Player hits player
    4 replies, posted
What code should I use, if I want to play a sound (or something along those lines) if a player shoots at another player and hits him?
[lua]function GM:EntityTakeDamage( ent, inflictor, attacker, amount )[/lua]
I'm pretty new at coding. I don't exactly know what to do with that.
Then you need to learn the basics of lua take a look at this [url]http://www.lua.org/manual/5.1/[/url] and this [url]http://wiki.garrysmod.com/?title=Lua_Tutorial_Series[/url]
ply:EmitSound(soundpath,100,100) that is after you have learned Lua basics :) Replace ply with which player you want to emit the sound, or you could make a SWEP emit the sound. Anyway you should learn the basics and practise with otehr things first :)
Sorry, you need to Log In to post a reply to this thread.