Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local part = script.Parent
- local cooldownTime = 2
- local cooldown = {}
- local function onTouched(hit)
- local character = hit.Parent
- local player = game.Players:GetPlayerFromCharacter(character)
- if player and not cooldown[player] then
- local leaderstats = player:FindFirstChild("leaderstats")
- if leaderstats then
- local cash = leaderstats:FindFirstChild("Cash")
- if cash then
- cash.Value += 25
- cooldown[player] = true
- delay(cooldownTime, function()
- cooldown[player] = false
- end)
- end
- end
- end
- end
- part.Touched:Connect(onTouched)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement