Why does it give me an abnormal amount of cash when the max set value is way less?

I have 2 scripts which handle this:

The Cash Touched Function(This is in the cash instance that i touch):

local db = false

script.Parent.Touched:Connect(function(child)
	local hum = child.Parent:FindFirstChild("Humanoid")
	if hum then
		local foundPlayer = game.Players:FindFirstChild(hum.Parent.Name)
		if foundPlayer then
			if db == false then
				db = true
				foundPlayer.SavedValues.DogeBucks.Value += math.random(script.Parent.Low.Value, script.Parent.High.Value)
				game.ReplicatedStorage.CollectedCash:FireClient(foundPlayer)
				script.Parent:Destroy()
			end
		end
	end
end)

Handles the DogeBucks and rewrites value on bottom left textlabel:

local DogeBucksLabel = GameUI.AmountBucks
DogeBucksLabel.Text = "$"..tostring(player.SavedValues.DogeBucks.Value)

game.ReplicatedStorage.CollectedCash.OnClientEvent:Connect(function()
	script.CashCollect:Play()
end)

player.SavedValues.DogeBucks:GetPropertyChangedSignal("Value"):Connect(function()
	DogeBucksLabel.Text = "$"..tostring(player.SavedValues.DogeBucks.Value)
end)

Video of the Problem(Please look everything through):

All Help is highly appreciated

i think the problem is the when you buy from the shop your deducting from a localscript so its not getting replicated to the server

so when you pickup more items the server continues where it last left of

2 Likes

Can you show the buy/purchase script?
I believe it’s not being sent through the server
You can see the cash normal until you buy something, then it’s about where you left off before buying something

1 Like

The server is the one that deducts the number from the IntValue, the local script makes it show on the TextLabel

Check the cash value on the server

1 Like

Ok so when i purchase something nothin happens on the server’s side only on the local side, I may know how to fix it now thankyou.