The main mistake is to use a public GUI instead of the player's GUI. the path to the local GUI is accessible via game.Players.LocalPlayer.PlayerGUI
local gui = game.Players.LocalPlayer.PlayerGui
local button = gui. -- Enter your path to button
button.MouseButton1Click:Connect(function()
button.Text = "Clicked"
wait(1)
button.text = "CLICK ME"
end)