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

Why it don't make the player change team?

Asked by 8 years ago
Edited 8 years ago
g = script.Parent -- g is actually the folder in which the script is and g is in ServerStorage
plr = g.Parent.Parent
wait(.5)
if plr:IsInGroup(1085813) then  --Group ID
    plr.TeamColor = BrickColor.new("White")
else
    plr.TeamColor = BrickColor.new("Pearl")
end
0
Only Local Scripts can use LocalPlayer. User#11440 120 — 8y
0
I've already realized it, but thanks. MatthewMinghetti 10 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

ServerStorage's do not run scripts. If you want to however make it change teams upon join, here is the proper coding.

Script Location: ServerScriptService

game.Players.PlayerAdded:connect(function(plr)
    if plr:IsInGroup(1085813) then 
        plr.TeamColor = BrickColor.new("White")
    else
        plr.TeamColor = BrickColor.new("Pearl")
    end
end)

I hope that helped. :)

0
That helped! Thanks :D MatthewMinghetti 10 — 8y
Ad

Answer this question