I have a speed button in my game, but I only want it to be only for specific people. My issue right now is that the button displays to everyone. Here's my code right now.
game.Players.PlayerAdded:Connect(function(plr)
game.StarterGui.ScreenGui:WaitForChild("Button")
if plr.UserId == 123 or plr.UserId == 321 then
script.Parent.Visible = true
script.Parent.Active = true
else
script.Parent.Visible = false
script.Parent.Active = false
end
end)
I have this script in the button I want to display, and it is a local script.
(Btw I'm inexperienced in Lua, I just started recently)

5 comments
Huh. This doesn't work either.
Yes it does. I tested it myself. Did you put it in a LocalScript, inside the GUI you want to be visible? Did you set the button to not visible in the property panel? You also need to make sure to add your userID in that table! Your userId = 171801589
If you still can't get it to work, send me a picture of your Explorer so I can try and assist you further.
OH I have the GUI set to visible by default. Let me test that.
Yep this works great! Thanks so much!