So I own a Roblox Army group, and I'm almost done with the base, except I can't seem to get this GUI to work. I'll post the code I have inside the TextButton Below.
function Click(mouse) if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(4123247) then script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Crimson") end end script.Parent.MouseButton1Click:connect(Click)
Any help would be appreciated.
There is no need to use tons of parents. This is local script, meaning you can reference the player by using game.Players.LocalPlayer
Result:
local player = game.Players.LocalPlayer function Click(mouse) if player:IsInGroup(4123247) then player.TeamColor = BrickColor.new("Crimson") end end script.Parent.MouseButton1Click:connect(Click)