Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 8 years ago

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?

0
If there's no longer any purpose for this question you can press the delete button on the right to delete it. Perci1 4988 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Never mind! Found out what to do.

0
Want me to lock the question so you don't get downvotes on the question or your answer? M39a9am3R 3210 — 8y
0
Yes, please. darkline1 0 — 8y
Ad

Answer this question