I’m making money printers, that a player places on the ground and the accumulate currency then by clicking on a button they are suppose to be able to withdraw the amount.
First I put the gui inside StarterGui, but then i realized that when the player respawns he can’t see the gui. So now I’ve decided to put the gui inside the printer itself, however, because it’s now on the server i can’t activate the button which was activated via a local script before.
I can only activate it with a Script and MouseButton1Click but this prevents me from knowing who clicked the button.
So now I am trying to figure out how i would activate the button and detect who clicked it, to check if the player who clicked it is the owner of the printer.
The way I would go about this is do the MouseButton1Click via client then use a RemoteEvent and let the server withdraw money for the player, good luck
I know that, the thing is how would i reference what button i mean when the printer is in replicated storage and i clone it into the game every time a printer is placed down
By default it is turned on, which makes the GUI reset to its original state whenever the player respawns.
If you are intent on doing it server-sided, have you considered setting a part with a ClickDetector over the button? The MouseClick event will pass along the player who clicked the part.