HowToRoblox

TakeMoneyScript

Jan 5th, 2020
1,288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. local click = script.Parent.ClickDetector
  2.  
  3. local doorOpened = false
  4.  
  5. local door = script.Parent
  6.  
  7.  
  8. click.MouseClick:Connect(function(plr)
  9.    
  10.     if doorOpened then return end
  11.    
  12.     if plr.leaderstats.Money.Value < 20 then return end
  13.  
  14.     doorOpened = true
  15.    
  16.    
  17.     plr.leaderstats.Money.Value = plr.leaderstats.Money.Value - 20
  18.    
  19.    
  20.     door.Transparency = 1
  21.    
  22.     door.CanCollide = false
  23.    
  24.    
  25.     wait(3)
  26.    
  27.    
  28.     door.Transparency = 0
  29.    
  30.     door.CanCollide = true
  31.    
  32.    
  33.     doorOpened = false
  34.    
  35. end)
Add Comment
Please, Sign In to add comment