function onTouch(part) if part.Parent:FindFirstChild("Humanoid") then local piggy = game.Players:GetPlayerFromCharacter(part.Parent) if piggy.TeamColor ~= BrickColor.new("Institutional white") then piggy.Neutral = false piggy.TeamColor = BrickColor.new("Institutional white") end end end script.Parent.Touched:connect(onTouch) for i,v in pairs(game.Players:GetPlayers()) do v.Character:MoveTo(Vector3.new(108, 11.19, -29)) end wait(1)
How can I get this so its just in one script, no part needed and it changes the players team back to Lobby and moves them back to those coords
Yeah, that wouldn't work. Define the player, and make sure that the part that touched the brick is part of a human.
function onTouch(part) if part.Parent:FindFirstChild("Humanoid") then --If part is part of a human local piggy = game.Players:GetPlayerFromCharacter(part.Parent) --Gets the player from the human. part.Parent is the Character model. if piggy.TeamColor ~= "Institutional White" then piggy.Neutral = false piggy.TeamColor = BrickColor.new("Institutional White") end end end script.Parent.Touched:connect(onTouch)