I’m making a gift entity for TTT, because of Christmas. I’ve pretty much got the entity down from working with the hp station code, but how do I drop it on a player’s death?
I know I’d be hooking a function to PlayerDeath, but how would I spawn the hp station? Would this work:
function SpawnGift( v, i, k )
local ch = math.random(1, 4) pos = v:GetPos() if ch == 1 then return end else local gift = ents.Create( "ttt_gift" ) if IsValid( gift ) then gift:SetPos ( pos ) gift:Spawn() end
hook.Add( “PlayerDeath”, “SpawnGift”, SpawnGift )