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

Why is this team-only GUI script not working?

Asked by
unmiss 337 Moderation Voter
9 years ago
local player = game.Players.LocalPlayer

function onAdded() 
    if player.TeamColor == BrickColor.new("Really red") then
        print("yay, "..player.Name" got his defender panel")
    else
        script.Parent:Remove()
    end
end 

game.Players.PlayerAdded:connect(onAdded) 

its in a localscript, I tried it in a normal script and it didn't work either. it still gives it to unauthorized teams and doesn't remove it when its supposed to on unauthorized teams

0
your adding the gui before the teamcolor even changes, if this is a localscript player is already added YellowoTide 1992 — 9y
0
Try adding a wait(3) or longer at the start of your script and make Remove() into remove(). How are players becoming the team? ROBLOX places players in a team by amount that are in one already to even it out 1 by 1. Unless there is another script changing teams alphawolvess 1784 — 9y
0
its admin.. unmiss 337 — 9y

Answer this question