local price = script.Parent.Parent.Price
local tools = game.ReplicatedStorage:WaitForChild("Tools")
local tool = script.Parent.Parent.ItemName
local player = script.Parent.Parent.Parent.Parent.Parent.Parent

script.Parent.MouseButton1Click:connect(function()
	if player.leaderstats:FindFirstChild("Levels").Value >= price.Value then 
		player.leaderstats:FindFirstChild("Levels").Value = player.leaderstats:FindFirstChild("Levels").Value >= price.Value
		game.ReplicatedStorage.ShopBuy:FireServer(tool.Value)
	end
end)

I'm trying to make the money stay as it is when you buy it, anyone have a clue how?

3 comments

1

You can achieve this through a DataStore—find more on the ROBLOX Developer Wiki.

1

Also, to give you a tip, looking at your script it seems as though you check how much money they have on the client. I recommend to not do that, instead check their amount on the server through your remote event.

0

You can optionally use a RemoteFunction, though.