Shop using DataStore Index Problem

  1. What do you want to achieve? A shop that gets the bool value from a boolvalue inside the player object

  2. What is the issue? I’m getting the error Players.aresrii.PlayerGui.BestShop.ScrollingFrame.BuyObamaFigure.Purchase:6: attempt to index number with 'ownsGear'

  3. What solutions have you tried so far? I searched for my problem on the DevForum and google and nothing is helping.

Note: The BoolValue is in the player successfully

local amountToRemove = 100

local remote = game:GetService("ReplicatedStorage").Remotes.RemoveCurrency

	if plr.ownsGear.OwnsObamaFigure.Value == false then
		plr.ownsGear.OwnsObamaFigure.Value = true
		script.Parent.Text = "you already have this dummy"
		script.Parent.TextColor3 =, 0, 0)
		script.Parent.Text = "obama figure                                                                  100 points"
		script.Parent.TextColor3 =, 0.854902, 0.854902)
1 Like

Is this the entire script? Cause I don’t see a datastore …

The DataStore part is in another script and I am using a RemoteEvent to remove money

theres a typo in your code

it should be : instead of a dot

Also, its really insecure to fire the amount to remove (if its a number) since an exploiter can just modify the Fire and change it to a large negative amount which will result in getting more money on the server end

1 Like

Are they any other secure methods to remove money you would recommend?