I would like this script to work every time its touched, but it doesn't seem to. It only seems to work until Hay.Transparency == 0 on line 18. Please help me, thanks!
moneyToGive = -25 debounce = false script.Parent.Touched:connect(function(hit) if debounce == true then return end player = game.Players:GetPlayerFromCharacter(hit.Parent) if player == nil then return end stat = player:findFirstChild("leaderstats") if stat == nil then return end cash = stat:findFirstChild("Cash") if cash == nil then return end debounce = true if cash.Value < 0 then script.Sound2:Play() wait(2) print "line 14" debounce = false --Forgot to disable debounce here end if cash.Value >= 0 then if game.Workspace.Desperado.Body.Hay.Transparency == 0 then script.Sound2LPlay() return end end if game.Workspace.Desperado.Body.Hay.Transparency == 1 then cash.Value = cash.Value + moneyToGive game.Workspace.Desperado.Body.Hay.Transparency = 0 print "Line 20" script.Sound:Play() game.Workspace.Desperado.Body.Cash20l.BillboardGui.Enabled = true wait(3.5) game.Workspace.Desperado.Body.Cash20l.BillboardGui.Enabled = false wait(2) debounce = false end end)