Script running but simply not doing what it says(no errors)

Im making a simulator type game where when you walk on to a certain part, you can sell your stuff. Ive made the code to take away your stuff, but no matter what i do, it just will not do anything.
The code sets the stat to zero but it doesnt actually happen in game. The puzzling thing is that there is no errors in the output

local hitbox = game.Workspace.SellBuildingHitbox

hitbox.Touched:Connect(function(hit)
    
    local plrname = hit.Parent.Name

    if game.Players:FindFirstChild(plrname) then
        
        local plr = game.Players:FindFirstChild(plrname)
        
        plr.Stats.Stomach.Value = 0 
        
        
    end

end)

Thanks in advance!

Leave a Comment