Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Button to teleport a player if they have a certain rank in a group not working?

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.

1 answer

✓ Accepted answer

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)

1 comment

0

Thank you, this helped me fix my script! I really appreciate your help.

This discussion is preserved as it was. New answers, comments, and votes are closed.