Advertisement
Joriangames

Coins script

Dec 2nd, 2020
4,752
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. --This script is created by Joriangames/Problox Studio Scripts
  2. --If you want to know how this works, watch the tutorial: https://youtu.be/24vBNhkcq-E
  3.  
  4. local debounce = true
  5.  
  6. script.Parent.Touched:Connect(function(hit)
  7.     if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  8.         if debounce == true then
  9.             debounce = false
  10.            
  11.             local player = game.Players:GetPlayerFromCharacter(hit.Parent)
  12.             player.leaderstats.Coins.Value = player.leaderstats.Coins.Value +1
  13.             script.Parent.Transparency = 1
  14.             wait(.5)
  15.             script.Parent:Destroy()
  16.         end
  17.     end
  18. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement