So I'm making a tree cutting game, in which you cut down trees which gives wood. Now I'm currently trying to make a selling area with a Touched function, but it doesn't seem to work.
script.Parent.Touched:connect(function(part) local plr = game.Players:GetPlayerFromCharacter(part.Parent) local cash = plr.leaderstats.Cash local gui = plr.PlayerGui.inventory local woodvalue = plr.PlayerGui.inventory.frame.wood.value if woodvalue.Value ~= 0 then cash.Value = cash.Value + woodvalue.Value woodvalue.Value = 0 end end)