I need to make a condition that runs some code if a certain player pushes a button. If another player pushes the button the condition won't run the code.
The problem that I am having is that I don't know how to make only a certain player can run the code like "DogeDark211", I only know how to run the code if anyone pushes the button, any help would be appreciated, thanks.
button = script.Parent Player = game.Players.LocalPlayer button.MouseButton1Click:connect(function() if Player.Name == "DogeDark211" then -- run code end end)
Hope this helps!
Player.Name gets the name of the local player and compare's it to yours.