NOTE: This brick is NOT a LocalSpawn.
print("Hello world!")
tm = script.Parent
function onTouched(hit)
local h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
local n = hit.Parent
local p = game.Players:FindFirstChild(""..n.Name.."")
if p ~= nil and p.TeamColor ~= tm.BrickColor then
h.Health = 0 --Remove this line if you don't want it to kill you. Although I don't recommend doing so, because if your place is a CTF, it may lead to the Player cheating by picking up the Flag without starting on the correct side.
p.TeamColor = tm.BrickColor --Change the color of the brick to the Desired Team Change destination.
else
print("You don't need to change. You're already on this team.")
else
print("You're not a person.")
end
end
script.Parent.Touched:connect(onTouched)
Theres the script. Anyone could tell me what to change?

1 comment
If there's no longer any purpose for this question you can press the delete button on the right to delete it.