I am making a shop (button) which will be invisible for certain players who enter the game. However, when I was testing it (I was one of the certain players), the button was still there on my screen. I have no idea what mistakes occured in the script. Can someone teach me how to fix it, please?
Below is my script:
--Should the script be a local script or normal script? local button = script.Parent local player = game.Players.LocalPlayer game.Players.PlayerAdded:connect(function() local admin = ( --The players who have one of the UserIds below should not see the button. player.UserId == 90568658 or player.UserId == 76204529 ) if admin then script.Parent.Visible = false else script.Parent.Visible = true end end)
Try. (P.S. Local)
local button = script.Parent local player = game.Players.LocalPlayer game.Players.PlayerAdded:connect(function() local admin = {--The players who have one of the UserIds below should not see the button. ["90568658"] = true; ["76204529"] = true } if player.UserID[admin] then script.Parent.Visible = false else script.Parent.Visible = true end end)