I can't figure out the error with my team change script?
I am trying to make it so when a player clicks a button (It's a ScreenGui) their team will be changed and their player will be loaded. Here's my script I can't figure out what i'm doing wrong. Btw this is a local script
--TEAM CHANGE--
local allowedTeam = BrickColor.new("White"); -- the color of the team they have to be on for it to change their team color--
local changedTeam = BrickColor.new("Really red"); -- the color i want them to change to when they click the button--
script.Parent.Mousebutton1Click:Connect(function()
01 | local plr = game.Players.LocalPlayer |
05 | if plr.TeamColor = = allowedTeam then |
07 | plr.TeamColor = changedTeam; |
end)