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

why wouldn't the script reconized the player names?

local access = {"players's name","players's name"}
local gamepassid = 00
local Player = game.Players.LocalPlayer
if game:GetService("MarketplaceService"):PlayerOwnsAsset(Player, gamepassid) or Player.Name == access then
script.Parent.Visible = true
else
script.Parent.Select.Disabled = true
script.Parent.Visible = false
end

Did i do something wrong on the first line?

1 answer

✓ Accepted answer
local access = {"players's name","players's name"}
local gamepassid = 00
local Player = game.Players.LocalPlayer
local authorized = false

for i = 1, #access do --this checks if the local player's name is equal to any of the names in the table
	if access[i] == Player.Name then
		authorized = true --set authorized to true if the name is in the table
		break
	end
end

if game:GetService("MarketplaceService"):PlayerOwnsAsset(Player, gamepassid) or authorized then
	script.Parent.Visible = true
else
	script.Parent.Select.Disabled = true
	script.Parent.Visible = false
end

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