So i made a simple script to give players cash when they touch a part, I added a debug so the players don't get a bunch of cash at once but my debug inst working, I've always had trouble with debugs and understanding them so any help will be great.
Debug = false
script.Parent.Touched:Connect(function(hit)
local player = hit.Parent:FindFirstChild("Humanoid")
if player and Debug == false then
Debug = true
local Char = game.Players:GetPlayerFromCharacter(hit.Parent)
Char.leaderstats.Cash.Value = Char.leaderstats.Cash.Value + 5
Debug = false
end
end)
