Create a Hook for a Job?
Last read Never
Excuse the Title if its unclear.
So I was wondering if it would be possible to write a Hook that if a Player with that certain Job gets Killed he Explodes.
I have 0 LUA experience but I'd imagine it be easy.
Thanks in advance.
https://wiki.facepunch.com/gmod/GM:PlayerDeath
Check if the player's team is equal to that job, and if they are create the explosion.
hook.Add("PlayerDeath", "some.hook", function(victim)
if(victim:Team() == TEAM_CITIZEN) then -- If the victim's team is equal to TEAM_CITIZEN
-- Boom Time
local blast = ents.Create("env_explosion")
blast:SetPos(victim:GetPos())
blast:Spawn()
blast:SetKeyValue("iMagnitide", "200")
blast:Fire("Explode", 0, 0)
end
end)
Side note: This thread should've been in this category: https://www.gmodstore.com/community/boards/19 :)
Thank you so much!
Yeah sorry diddn't know that :/
Not sure why but "Boom time" amuses me more than it probably should
Same XD
Users viewing this thread
Nobody