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

How to put people on a team? (CERTAIN PEOPLE)

Asked by 10 years ago

How do i put myself on team owner?

1 answer

Log in to vote
0
Answered by 10 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.

Here's some code I wrote, I'm not sure if it will work:

a = game.Players:GetChildren()

game.Players.PlayerAdded:connect(function()
for i,v in pairs(a) do
    if v.Name == "groovydino" then
        v.TeamColor = BrickColor.new("Really Red") --Change really red to whatever teamcolor the "Owner" team is
    else
        v.TeamColor = BrickColor.new("Medium Stone Grey") --Default player teamcolor
    end
end
end)

If that doesn't work, let me know, but it should. Just drop that script into the Workspace and it should work.

0
The definition of `a` must occur upon the event, rather than just initially. BlueTaslem 18071 — 10y
Ad

Answer this question