Advertisement
TheDev321

Untitled

Sep 15th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.27 KB | None | 0 0
  1. if b.Name == v then
  2.                        
  3.                         local Goal = b:WaitForChild("ProgressHolder"):WaitForChild("Goal")
  4.                         local Amount = string.match(Goal.Text, "%d+")
  5.                        
  6.                         if game:GetService("ServerStorage"):FindFirstChild(Player.UserId) == nil then
  7.                        
  8.                             local PlayerFolder = Instance.new("Folder")
  9.                             PlayerFolder.Name = Player.UserId
  10.                             PlayerFolder.Parent = game:GetService("ServerStorage")
  11.                            
  12.                             local ChallengeGoals = Instance.new("Folder")
  13.                             ChallengeGoals.Name = "ChallengeGoals"
  14.                             ChallengeGoals.Parent = PlayerFolder
  15.                            
  16.                             local Template = Instance.new("Folder")
  17.                             Template.Name = v
  18.                             Template.Parent = ChallengeGoals
  19.                            
  20.                             local AmountV = Instance.new("IntValue")
  21.                             AmountV.Name = "Amount"
  22.                             AmountV.Value = Amount
  23.                             AmountV.Parent = Template
  24.                            
  25.                         else
  26.                            
  27.                             local PlayerFolder = game:GetService("ServerStorage"):FindFirstChild(Player.UserId)
  28.                            
  29.                             if PlayerFolder then
  30.                                
  31.                                 local ChallengeGoals = PlayerFolder:FindFirstChild("ChallengeGoals")
  32.                                 local Temp = ChallengeGoals:WaitForChild(b.Name)
  33.                                 local AmountV = Temp:WaitForChild("Amount")
  34.                                 AmountV.Value = Amount
  35.                                
  36.                             end
  37.                            
  38.                         end
  39.                    
  40.                     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement