im getting confused both of you guys are giving me answers and I dont know whoms to do. A remote event fires a script or a piece of script to another script? do i put a local script in starter player scripts and do my gui there? I am so confused right now
All a RemoteEvent does is provide a way for a local script and server script to signal each other with information!
Yes, or you could put the local script in the GUI if you wanted to for your own personal organization reasons
im currently watching a tut on remote events so its starting to make since on remote events
Do as Floof said. I agree with what he is saying (I personally will stick to serverscripts in stores I donât think of it as weird but as a way of reducing the amount of sanity checks/remote events).
One of my friends has a game called Dysfunctional Diner and he has a Module Script called Purchase Handler that im assuming doesnt use remote events because its on ServerScriptService, almost all of his scripts are module scripts except 2 Data handlers, one is server and one is local, do u have an idea on that?
Yeah I still think you should use a ServerScript for obvious reasons but sanity checks can be reduced with things like server side price handling and Iâm pretty sure you canât even get events like MouseButton1Click
or any sort of GUI activation from the Server, correct me if Iâm wrong though.
The location doesnât influence stuff like that with the script. A script in ServerScriptService is just as likely to use RemoteEvents as a script located anywhere else.
This is exactly how my game is structured. Itâs an advanced method of organization that can reduce clutter and improve the ability to refactor code depending on how itâs executed. Itâs not something you need to worry about much as a beginner but is definitely a pattern you should consider as you grow your skills.
oh he does have remotesssssssss
so make a local script in player scripts thats suppossed to be the client and server scripts are the server?
and can you make it into a module script and do the PurchaseHandling there?
Yep!
Technically you could but I donât recommend this if youâre a beginner. Itâs a bit more complicated to get set up and might be overwhelming if you donât know what youâre doing.
ig ill convert my game into modulescript later and just do regular scripts and local scripts for now
one last thing, so can you make a summary of all we just said? so i can start on the coding for remote events and all that stuff, and i can just get the player by doing the built-in roblox thing and refrencing leaderstats. floofy please and thank u for ur time
To handle the shop, have a LocalScript and server Script that handle the shop GUI and purchase starting and the actual process of checking the player separately. Use a remote event to send a signal (and any associated information) and use the player parameter you receive to get the player object.
It works! Thank you so much!!! I have learned so much in 1 hour lol
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.