Issue with creating a backpack shop

Hello,
So I was working on a “backpack shop” similar to multiple simulators but I am running into a bit of an issue and I don’t know what is the issue since there no error in the output.

This is what happens when I run the script
https://gyazo.com/d8f57a36707f92da75c31139216bc8cf

What I want, is when I buy a backpack I want it to create one string value in a specific folder so I will be able to save them.

5 Likes

May we see the console output? This is probably a client code issue but console output will confirm that.

1 Like

Anything errors in the output?

1 Like

I am having no error whatsoever that is why I am asking here on the devforum for help.
@CheetahSp33d and @sz_s

1 Like

https://developer.roblox.com/en-us/articles/Debugging

To open the Output window in Studio, click on the View tab and then on Output.

Can you test again and tell us what the Output window says?

1 Like

will do in a moment since I closed out of studio

Here you go:
https://gyazo.com/d90858d5b8e6565cfb06474a5806b2fc

1 Like

Are you printing warnings as well? That’s strange because in your code, you print a warning whenever the player invokes the remote, and that warning is not showing up on the console.

1 Like

wait I am stupid I disabled the script. Ill post it once again.

https://gyazo.com/e76fc6dee77ebe473180d0fa9d715eed

1 Like

Thanks. Yep, that confirms the error is on the client side, since the remote is invoked several times when you only clicked the button once.
Can you please show us the client-sided code? (The code that manages the UI)

1 Like

here you go (30 char)

2 Likes

Ah, I see the problem. Inside every iteration of the loop

for i, BP in pairs(BackpackData) do

you are connecting the MouseButton1Click event to the BuyButton, which creates multiple connections to the button. What you really want to do is keep track of which backpack the player is currently focused on, so you only need to connect a single clicked event to BuyButton.

2 Likes

Oh that make sense ill try to find a solution if it didn’t work ill get back to you.

2 Likes