I have no idea why, it should be returning true, but in the console it keeps returning false. They are then student team so they should be being moved to the dead team.
function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
local baddie = game.Players:GetPlayerFromCharacter(humanoid.Parent)
print(baddie.TeamColor == game.Teams.Students)
if baddie.TeamColor == game.Teams.Students then
local Pos = workspace.lobby.LobbyTele --Gets the Part to teleport to.
local character = humanoid.Parent
local player = game.Players:GetPlayerFromCharacter(character)
player.TeamColor = game.Teams["Dead"].TeamColor
part.Parent:moveTo(Pos.Position)
wait(0)
workspace.lobby.LobbyTele.Locked = false
script.dead:Play()
end
wait(1)
end
end
script.Parent.Touched:connect(onTouch)

2 comments
holy crap your organization is badddd
Try “game.Teams.Students.TeamColor”.