You can write your topic however you want, but you need to answer these questions:
-
Q: What do you want to achieve? Keep it simple and clear!
A: I have a shop and when you click the item it fires remote event that gives you the tool. -
Q: What is the issue? Include screenshots / videos if possible!
A: Every time I click it is giving me more tools as showed below.First Time . … … … … 1 Tool
Second Time … … … 2 Tools
Third Time … … … … 3 Tools
n Time … … … … … … n Tools -
Q: What solutions have you tried so far? Did you look for solutions on the Developer Hub?
A: Actually this is the second time I am making a topic about this one. But the first one didn’t help me much because it was about changing the:Connect()
to:Once()
and it works but I want to make player be able to purchase item again and again. The guy said: “You are connecting the event too many times, it gives extra every time.”
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Below all my scripts about this:
- GUIReplicator : LocalScript
- Used to generate the GUI using template GUI and template cells for items. Then relocates the GUI into the PlayerGui. Fires an remote event when clicked on item.
- Has 3 children:
- Items : Folder
- Contains items to be placed in GUI.
- TemplateShopGUI : ScreenGui
- TemplateCell : Frame
- Contains a viewport frame to display the item.
- Items : Folder
- Github - GUIReplicator
- ValidateScript : Script
- Used to handle remote event and check if player has enough cash, then gives the tool and fires the remote event back with arguments: RespondTable and HashGUID.
RespondTable has 2 entries. First one is used to know if succeed or fail. Second one is a GUID created per every item and sent to ValidateScript by remote event. This argument is used to make sure it is the correct process. - Github - ValidateScript
- LeaderstatsScript : Script
- I won’t put the script here because it is too simple and I am sure that the problems source is not it.
Also the first topic is here too, but reminder that I changed the scripts and they have a little difference. Also their name is changed.
I couldn’t find any solutions. Appreciate if you can!