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

Group Rank limited GUI not working?

Asked by 10 years ago

I have a GUI set up like so, -Player1 --PlayerGui ---ScreenGui ----TextButton -----script

I am trying to make a teleport script that only works for certain ranks in the group but my code will not run past my if statement, any help?

local isAdmin = {[1] = true, [2] = true, [254] = true, [255] = true}
print'1'
function Click(mouse)
if isAdmin[script.Parent.Parent.Parent.Parent:GetRankInGroup(1217013)] then
    print'2'
script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(-102.65, 40.85, 33.35)
end
end

script.Parent.MouseButton1Click:connect(Click)

Yes I am in that group and yes I am one of those ranks.

1 answer

Log in to vote
0
Answered by 10 years ago

****Try putting this in a local script

local isAdmin = {[1] = true, [2] = true, [254] = true, [255] = true}
player = game.Players.LocalPlayer

function Click(mouse)
if [player:GetRankInGroup(1217013)] then
script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(-102.65, 40.85, 33.35)
end
end

script.Parent.MouseButton1Click:connect(Click)
Ad

Answer this question