Advertisement
HowToRoblox

RobberySystem

Sep 4th, 2021
3,849
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. game.Players.PlayerAdded:Connect(function(plr)
  2.    
  3.    
  4.     local ls = Instance.new("Folder")
  5.     ls.Name = "leaderstats"
  6.     ls.Parent = plr
  7.    
  8.     local cash = Instance.new("IntValue")
  9.     cash.Name = "Cash"
  10.     cash.Parent = ls
  11. end)
  12.  
  13.  
  14.  
  15. local pps = game:GetService("ProximityPromptService")
  16.  
  17.  
  18. pps.PromptTriggered:Connect(function(pp, plr)
  19.    
  20.    
  21.     if pp.Name == "RobPrompt" then
  22.        
  23.         local robbedAmount = math.random(100, 500)
  24.        
  25.         plr.leaderstats.Cash.Value += robbedAmount
  26.        
  27.        
  28.         pp.Enabled = false
  29.        
  30.         wait(30)
  31.        
  32.         pp.Enabled = true
  33.     end
  34. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement