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

GUI that function only if you are certain ranks in a group, why doesn't this work?

Asked by 9 years ago

I am trying to make a teleporting GUI that only teleports if you are a certain rank in the group. I have this in a regular script because I do not believe that :GetRoleInGroup will work using local player and if it does please correct me. It prints 1 but it does not get to 2. Any reason why The parent of the starter GUI does not yield one of those numbers? And when testing it I am one of those ranks so that is not an issue.

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

script.Parent.MouseButton1Click:connect(Click)

Answer this question