Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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

Log in to vote
0
Answered by 4 years ago

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)
0
Thank you, this helped me fix my script! I really appreciate your help. OrbitOps 34 — 4y
Ad

Answer this question