I have created a GUI button that will teleport a player to another area in my game, but only if they have a certain rank in a group.
This is my script:
function Click() if game.Players.LocalPlayer:GetRankInGroup(my group ID is here) >= 1 then script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(-6.5,3,-68) script.Parent.MouseButton1Down:connect(Click) end
It works fine, but line 2 (the line that gets the group rank) won't work. I've tried it as both a Script and a LocalScript.
Try this?
function Click() if game.Players.LocalPlayer:GetRankInGroup(my group ID is here) >= 1 then script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(-6.5,3,-68) end script.Parent.MouseButton1Down:connect(Click)