Hey. I was hoping someone can help me with this. When someone dies, you can click the mouse to respawn. Is there a way to disable that and keep them dead for a certain amount of time? I know you would have to create a timer to spawn them. Can someone help? Thanks.
[url]http://wiki.garrysmod.com/?title=Gamemode.PlayerDeathThink[/url]
That is the main script for respawning if you dont have one yourself
(I THINK)
Change that so you doesent respawn from clicking any mousebuttons.
Then make a timer that makes the player spawn on playerdeath.
[url]http://wiki.garrysmod.com/?title=Gamemode.PlayerDeath[/url]
[lua]
hook.Add( "PlayerDeath", "Respawn", function Respawn( victim, weapon, killer )
timer.Create("Respawn"..victim:SteamID(), 10, 1, function()
victim:Spawn()
end )
end )
[/lua]
Well, did it work?
[QUOTE=Dragge;21541514]Well, did it work?[/QUOTE]
Oh, sorry. No it didn't work. When I put it in the gamemode, the player loadout was messed up and the HUD didn't appear. I put it in init.lua.
Sorry, you need to Log In to post a reply to this thread.