Making 2 slenders instead off one when players >= 15, help

This is the code from stop it slender:
[lua] function GM:PlayerInitialSpawn( pl )

if CurTime() - ROUNDTIME <= 2*60 or #player.GetAll() <= 1 then

	if #player.GetAll() > 1 and #team.GetPlayers(TEAM_SLENDER) <= 0 and #ents.FindByClass("slendy") <=0 then
	
		local slendy = player.GetAll()[math.random(1,#player.GetAll())]
				
		if !pl:IsBot() and self.LastSlender ~= pl then
			pl:SetTeam(TEAM_SLENDER)
			self.LastSlender = pl
			game.GetWorld():SetDTEntity(2,pl)
			pl:CollisionRulesChanged()
		else
			pl:SetTeam(TEAM_HUMENS)
			pl:CollisionRulesChanged()
		end
		
	else
		pl:SetTeam(TEAM_HUMENS)
		pl:CollisionRulesChanged()			
	end
	
else
	pl:SetTeam(TEAM_SPECTATOR)
	pl:CollisionRulesChanged()
end

pl:SetCustomCollisionCheck(true)

pl:SetFrags(0)
pl:SetDeaths(0)

pl:SetPages( 0 )

net.Start( "InitialSpawn" )
net.Send(pl)

pl:SendLua("FixMotionBlur()")

end [/lua]

I have tried editing the start
[lua] if #player.GetAll() > 1 and #team.GetPlayers(TEAM_SLENDER) <= 0 and #ents.FindByClass(“slendy”) <=0 then

		local slendy = player.GetAll()[math.random(1,#player.GetAll())]

  elseif #player.GetAll() =&gt; 15 and #team.GetPlayers(TEAM_SLENDER) &lt;= 0 and #ents.FindByClass("slendy") &lt;=0 then

                  local slendy = player.GetAll()[math.random(2,#player.GetAll())] [/lua]

But i don’t know if that works, cause i can only use bots as an example, and i don’t think they count as players

[lua]elseif #player.GetAll() > 20[/lua]

According to the code, it will only choose two slendermen if it’s 21 or more. Try this:

[lua]if #player.GetAll() > 1 and #team.GetPlayers(TEAM_SLENDER) <= 0 and #ents.FindByClass(“slendy”) <=0 then

		local slendy = player.GetAll()[math.random(1,#player.GetAll())]

  elseif #player.GetAll() &gt;= 15 and #team.GetPlayers(TEAM_SLENDER) &lt;= 0 and #ents.FindByClass("slendy") &lt;=0 then

                  local slendy = player.GetAll()[math.random(2,#player.GetAll())][/lua]

Okay yeah, i saw that and changed it, but the thing is, i have no way of testing this untill there is 15 players, so i am asking, will this code work?

It should. Try using bots to test it.

I spawned in 16 bots and when i became slender man, i didn’t see another slender by holding tab or using my vision

[editline]5th September 2013[/editline]

Actually, i cannot get the round to start now :confused:

[editline]5th September 2013[/editline]

Nope, doesn’t work

Try this

[lua] function GM:PlayerInitialSpawn( pl )

if CurTime() - ROUNDTIME &lt;= 2*60 or #player.GetAll() &lt;= 1 then

	if #player.GetAll() &gt; 1 and #team.GetPlayers(TEAM_SLENDER) &lt;= 0 and #ents.FindByClass("slendy") &lt;= 0 then
	
		local slendy = player.GetAll()[math.random(1,#player.GetAll())]
			
	elseif #player.GetAll() &gt;= 2 and #team.GetPlayers(TEAM_SLENDER) &lt;= 1 and #ents.FindByClass("slendy") &lt;= 1 then
				
		if !pl:IsBot() and self.LastSlender ~= pl then
			pl:SetTeam(TEAM_SLENDER)
			self.LastSlender = pl
			game.GetWorld():SetDTEntity(2,pl)
			pl:CollisionRulesChanged()
		else
			pl:SetTeam(TEAM_HUMENS)
			pl:CollisionRulesChanged()
		end
		
	else
		pl:SetTeam(TEAM_HUMENS)
		pl:CollisionRulesChanged()			
	end
	
else
	pl:SetTeam(TEAM_SPECTATOR)
	pl:CollisionRulesChanged()
end

pl:SetCustomCollisionCheck(true)

pl:SetFrags(0)
pl:SetDeaths(0)

pl:SetPages( 0 )

net.Start( "InitialSpawn" )
net.Send(pl)

pl:SendLua("FixMotionBlur()")

end[/lua]

Also, are humans supposed to be spelled “humens” in the gamemode?

yes

Did the code work?

I can’t tell as off now, i’ll check later