Answered by
4 years ago Edited 4 years ago
it better be a local script for it to work properly. You detect button press
1 | script.Parent.MouseButton 1 Down |
then you use a remote event, fire it
1 | game.ReplicatedStorage.RemoteEvent:FireServer() |
then set up a listener with a server script
1 | game.ReplicatedStorage.RemoteEvent.OnServerEvent |
then make the transaction work, and you can pass information over from client to server using parameters like what ur buying
1 | game.ReplicatedStorage.RemoteEvent:FireServer( "chocolate" ) |
but remember, automatically the first parameter for the listener is the player who fired the event, so set up parameters like this
1 | game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect( function (player, parameter 1 ) |
3 | if paremeter 1 = = "chocolate" ... |
I hope this is the answer you were looking for... if not, then i will help