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

Group Rank limited GUI not working?

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

****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)

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