Advertisement
luchitasin9

Give Cash Script

Feb 9th, 2025
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | Source Code | 0 0
  1. local part = script.Parent
  2. local cooldownTime = 2
  3. local cooldown = {}
  4.  
  5. local function onTouched(hit)
  6.     local character = hit.Parent
  7.     local player = game.Players:GetPlayerFromCharacter(character)
  8.     if player and not cooldown[player] then
  9.         local leaderstats = player:FindFirstChild("leaderstats")
  10.         if leaderstats then
  11.             local cash = leaderstats:FindFirstChild("Cash")
  12.             if cash then
  13.                 cash.Value += 25
  14.                 cooldown[player] = true
  15.                 delay(cooldownTime, function()
  16.                     cooldown[player] = false
  17.                 end)
  18.             end
  19.         end
  20.     end
  21. end
  22.  
  23. part.Touched:Connect(onTouched)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement