How do i detect what player clicked a GUI button

You just fire a remote to the server which in turn fires to all clients.

button.Activated:Connect(function()
    remote:FireServer()
end)

remote.OnClientEvent:Connect(function(message)
    print(message) -- just an example
end)

Then in your server script.

remote.OnServerEvent:Connect(function(player)
    remote:FireAllClients(player.Name .. " clicked the button")
    -- the resetting code down here
end)
4 Likes