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

Why isn't this whitelist only working for whitelisted people?

This is a script that adds a whitelist to an admin GUI I'm working on, however for some reason, everyone still has access to it.

wait(3)
permission = {"DominousSyndicate"} --Put people you want to be VIP/staff here

function checkOkToLetIn(name) 
	for i = 1,#permission do 
		if (string.upper(name) == string.upper(permission[i])) then return true end 
	end 
	return false 
end 

if (checkOkToLetIn(script.Parent.Parent.Parent.Name)) then 
script.Parent.Enabled = true
else script.Parent:remove()
end 

3 comments

0

script.Parent:remove() <-- Change this to "script.Parent:Destroy()", might be a possible fix

0

remove is deprecated for that matter^

0

the brackets in your if statements gives me a hard time reading them and they're irrelevant

1 answer

Try this:

wait(3)
permission = {
user = {"DominousSyndicate"},
} --Put people you want to be VIP/staff here

function checkOkToLetIn(name) 
    for i,v in pairs(permission) do
	if v.user == name then
		return true
	else
		return false
	end
	end
end 

if (checkOkToLetIn(script.Parent.Parent.Parent.Name)) then 
script.Parent.Enabled = true
else script.Parent:Destroy()
end 


1 comment

0

This didnt work

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