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

How would I allow specific users to view a frame?

This frame is inside a gui and only users that are listed should be able to view it. This script does not work, so what could I do to check if the player is in the Admin table?

Here is my attempt

Admin = {"IntellectualBeing"}

local Frame = script.Parent
if Admin then 
Frame.Visible = true
else
print('You do not have permission to view this!')

end)

1 answer

✓ Accepted answer

It's in a table, so it's like you're getting a list of names, use a loop to retrieve the names.

Admin = {"IntellectualBeing"}

local plr = game.Players.LocalPlayer
local Frame = script.Parent

for i = 1, #Admin do
	if plr.Name == Admin[i] then
	Frame.Visible = true
	else
	print('You do not have permission to view this!')
	end
end

1 comment

0

Oh, okay. I see what I did wrong and I will use the loop when dealing with tables. Thanks for the help!

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