Okay, I'm making a group. That is based off of the Secure Contain Protect foundation. Now, I need help making it so only a certain rank. Can switch to the Foundation Personnel team. I need the rank number as 1. The code below shows the basic team change, but I need help making it so only ranks can switch to this team through roblox groups. Please respond if you have the time, thank you.
function Click(mouse) if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(703942) then script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Bright blue") end end
script.Parent.MouseButton1Click:connect(Click)

4 comments
Thanks for the fast reply! But it didn't work for me, This is how I pasted my code. Please tell me if I did something wrong.
Player = game.Players.LocalPlayer function Click(mouse) if Player:IsInGroup(2641004) and Player:GetRankInGroup(2641004) >= 2 --[[Rank # Example:"1" or "255" etc]] then Player.TeamColor = BrickColor.new("White") end end script.Parent.MouseButton1Click:connect(Click)
Did you insert the script into a 'Clickable' TextButton?
It's already inside one.