function Click(mouse) -- Clickity click if Player:GetRankInGroup(944397) == 10 then print("Player is a FI+ YAY!") --If FI+ script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Bright red") --Team color script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 --Kills the player. else print("Player not a FI") --If not FI+ end end) script.Parent.MouseButton1Down:connect(Click)
I do not understand why it won't work.
I agree with the above, the variable Player
was not properly defined. However, since you seem to only have 2 teams I personally would do away with the GUI idea instead. If you had people who met the requirements for multiple teams a GUI would make sense so they could select a team. Yet, you don't seem to have that. Instead, if I myself was in this scenario would just write an Auto Team on Join script. I enclosed one I used a long while back below for you to reference from.
local ID = 760517 game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:wait() if player:GetRankInGroup(ID) == RANKTHATCANACCESS then player.TeamColor = game.Teams["FIRST TEAM NAME"] player:LoadCharacter() else player.TeamColor = game.Teams["SECOND TEAM NAME"].TeamColor player:LoadCharacter() end end