Need help with my sell platform not registering the currency value

I want to make it so I can step on the shop platform and it resets my cereal value to 0 and add it to my cash value


(Picture of the tools script to add one to the cereal value)

(Sell script for the sell platform)
image
(leaderstats script if that affects anything)

You’re changing it from the local standpoint, the server won’t be able to see the changes made by the Cereal.Value

Also can’t you just use the Tool.Activated event?

Change the script to a Server Script, and put this instead:

local Tool = script.Parent

Tool.Activated:Connect(function()
    local Character = Tool.Parent
    local Player = game.Players:GetPlayerFromCharacter(Character)
 
    if Player then
        local Stats = Player:WaitForChild("leaderstats").Cereal
        Stats.Value += 1
    end
end)
1 Like