Slender is human Stop It Slender!

I edited the stop it slender code, original code
[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]

Edited code
[lua]
local meta = FindMetaTable(“Player”)

function meta:GiveToken(amount)

if self.token == nil then self.token = 0 end

self.token = self.token + amount

end

function meta:HasToken()
return self.token!=nil
end

function collectallpages( )

for v,ply in pairs (player.GetAll()) do

if ply:GetPages() >= 1 then
ply:GiveToken(10)
end
end
end
hook.Add( “Think”, “allpages”, collectallpages )

function GM:PlayerInitialSpawn( pl )

for v,ply in pairs (player.GetAll()) do

if ply:HasToken() then
ply:SetTeam(TEAM_SLENDER)
self.LastSlender = pl
game.GetWorld():SetDTEntity(2,pl)
pl:CollisionRulesChanged()
end
end

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())]
			
	elseif #player.GetAll() >= 21 and #team.GetPlayers(TEAM_SLENDER) <= 1 and #ents.FindByClass("slendy") <= 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]

And when i add bots, and get a page, i slay everyone to test what happens, when round restarts it sets 2 people into slender, and they walk around like people with a flashlight also they can see people trough the wall in green, when you go up to a bot it doesn’t hurt them, and when i go up to the other slender it just gives me visual effects

How do i make it only 1 slender if they get the notes? and fix the bugs?