Hello I've started writing gamemode in Garry's Mod 13 beta
I want to that player joins first to spectator mode before they choose a team.
For debugging I put a zombie.
[CODE]
function GM:PlayerInitialSpawn( ply ) // When spawning after joining the sever
local tr = ply:GetEyeTrace() -- tr now contains a trace object
local ent = ents.Create("npc_zombie") -- This creates our zombie entity
ent:SetPos(tr.HitPos) -- This positions the zombie at the place our trace hit.
ent:Spawn() -- This method spawns the zombie into the world, run for your lives! ( or just crowbar it dead(er) )
function joining( ply, ent )
ply:Spectate( OBS_MODE_ROAMING )
ply:SpectateEntity(ent)
ply:SetTeam( 4 ) //Set his team to Joining
end
timer.Simple( 1, function() joining(ply, ent) end )
end
[/CODE]
But the zombie still see me and follows me when I fly arround, but didn't attack me.
Also I can switch from noclip. Oo
How can I deactivate the spawn if u push fire button or something?
Sorry, you need to Log In to post a reply to this thread.