Okay basically i'm just trying to make kind of a cookie clicker game.
I have a local script inside a button, which is inside a screen gui. The script has the following code inside it:
script.Parent.MouseButton1Click:Connect(function()
game.Players.LocalPlayer.leaderstats.Cash.Value = game.Players.LocalPlayer.leaderstats.Cash.Value + 1
wait(0.1)
end)
Basically this is supposed to give the player 1 more cash every time he clicks the button, which it does do that, but only the player who clicked it sees this, no one else does.
I'm assuming I have to use an event in order to make this work, however i'm not entirely sure how those work yet, and any help/explanations would be very appreciated!
Also, how do I organize my code in a way that people can understand? I have seen people get the numbers out beside but I don't know how to do that.

2 comments
Assuming your game is FE, this would be exploitable. You need to create and set the leaderstat values in the server and have the server change it. The server will replicate the value to other players, so there is no need for remote events. If you use GUIs for clicking, you have to use Remote Events to communicate with the server. Otherwise you can use ClickDetectors on the server.
Okay, thanks. I'll try to see what I can do.