Keep player dead for a certain time

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.

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.

[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?

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.