I created a script that removes a value and replaces it for a different value here is the script:
function Sell(hit)
local Sell = Instance.new("IntValue")
local Quick = hit.Parent:FindFirstChild("Ore")
local Quick2 = hit.Parent:FindFirstChild("Cash")
hit.Parent:FindFirstChild("Ore").Sell.Value = Quick.Sell.Value - 1
hit.Parnet:FindFirstChild("Cash").Sell.Value = Quick2.Sell.Value + 100
end
script.Parent.Touched:connect(Sell)
I don't know what is wrong with it. If there is something I could add on to make it so it doesn't have a chance of exploits. Please point out why this isn't working. Thank you. Already tried: hit.Parent:FindFirstChild("leaderstats") as a string to connect to the values. That's it.

2 comments
Are you trying to make it so if a player touches it?
line 6 you spelled 'parent' wrong