Why does the player spawn when I don't want it to.

I don’t get it.
[lua]function GM:PlayerInitialSpawn( player )
player.IsDead = true;
print(player:Alive()) --< false

function GM:PlayerDeathThink( player )
if( player.IsDead )then
return true;
SpawnPlayer( player )

The player seems to just spawn the first time it joins, why is this? The other times when the player just dies it works.

  1. PlayerInitialSpawn is called when the player initializes into the world (during connection)- not the first time they spawn into the game. You’re also using the Player.KillSilent() on them during PlayerInitialSpawn… what’s the point of that?
  2. I can’t really figure how you’re using Player.IsDead… I don’t see that in the wiki- if its something you made (or part of another addon) then you probably have to change the value yourself. You’re only ever setting it to true.
  3. If you’re trying to do a forced respawn system, look at the wiki article for **[Gamemode.PlayerDeathThink

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.PlayerDeathThink)**- (Heck, look at it even if you aren’t).

  1. I’m killing the player and set player.IsDead so he doesn’t respawn again
  2. As long as player.IsDead is true then don’t spawn.
  3. I looked there.

All I want to do is stop the player from spawning until player.IsDead is false.

I guess I’ll try and killsilent the player in PlayerSpawn instead.