I am making a simple Cash leaderstats thing which works based off of parts called coins that are each colored differently. Each are colored colored for bronze, silver, and gold. Each coin works as far as giving their correct value and etc. The only real problem is that I don't know how to make them go back down(as when they're touched they're Vector3's y axis goes up).
script:
for i,v in pairs(game.Workspace:GetChildren()) do if v.Name == "Coin" then v.Touched:connect(function(hit) C = hit.Parent.Name lel = game.Players:FindFirstChild(C) if lel then Cash = lel.leaderstats.Cash end if v.BrickColor == BrickColor.new(106)then Cash.Value = Cash.Value + 5 wait(.1) v.Transparency = 1 wait(10) v.Transparency = 0 wait(1) end if v.BrickColor == BrickColor.new(329)then Cash.Value = Cash.Value + 10 v.Transparency = 1 wait(10) v.Transparency = 0 wait(1) end if v.BrickColor == BrickColor.new(24)then Cash.Value = Cash.Value + 15 v.Transparency = 1 wait(10) v.Transparency = 0 wait(1) end end) end end