Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What do I change so the brick changes it's teamcolor of player to wanted team?

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

0

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

1 answer

Never mind! Found out what to do.

2 comments

0

Want me to lock the question so you don't get downvotes on the question or your answer?

0

Yes, please.

This discussion is preserved as it was. New answers, comments, and votes are closed.