Advertisement
KashTheKingYT

Application Manager

May 1st, 2022
1,194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. local joinEvent = game.ReplicatedStorage:FindFirstChild("JoinJob")
  2.  
  3. --Functionality
  4.  
  5. function join(player, job)
  6.     if job and game.Teams:FindFirstChild(job) and player.Team ~= game.Teams:FindFirstChild(job) then
  7.         print(job)
  8.         player.Team = game.Teams:FindFirstChild(job)
  9.        
  10.         while player.Team == game.Teams:FindFirstChild(job) do
  11.             wait(300)
  12.             player.leaderstats.Money.Value += game.Teams:FindFirstChild(job).MoneyPer5Minutes.Value
  13.         end
  14.     end
  15. end
  16.  
  17. game.Players.PlayerAdded:Connect(function(player)
  18.     local leaderstats = Instance.new("Folder", player)
  19.     leaderstats.Name = "leaderstats"
  20.    
  21.     local money = Instance.new("IntValue", leaderstats)
  22.     money.Name = "Money"
  23. end)
  24.  
  25. --Connections
  26.  
  27. joinEvent.OnServerEvent:Connect(join)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement