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

Why wont this if statement to block changing a certain teams team?

Asked by 6 years ago

Why wont this if statement work to block people changing the team of a certain team?

if game.Players[SelectedPlayer].TeamColor ~= ("Shamrock") then
script.Parent.MouseButton1Down:connect(function(p)
    SelectedPlayer = script.Parent.Parent.TextBox.Text
    if game.Players[SelectedPlayer].TeamColor ~= ("Shamrock") then
        game.Players[SelectedPlayer].TeamColor = BrickColor.new(team)
        game.Players.LocalPlayer.PlayerGui.Classification.Enabled = false
    else
        print("cant change officers")
    end
end)

Thank you in advance!

0
On line 4, what is "team" in the ()? Also are you getting any errors or are you getting the else print? User#20279 0 — 6y
0
"team" is "Really black" And I have confirmed I am not getting any errors with the script. RexRicher 0 — 6y
0
Try adding "BrickColor.new" before the "Shamrock" on line 3. User#20279 0 — 6y
0
Oh my god thank you!!!! It worked! Ive been chasing this all day! RexRicher 0 — 6y

Answer this question