Advertisement
Honansik

Retail Tycoon 2 Script

Nov 11th, 2021
24,945
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.14 KB | None | 0 0
  1. local library = loadstring(game:HttpGet(('https://raw.githubusercontent.com/Maxgat5/UiLib/main/lua')))()
  2. local w = library:CreateWindow("Retail Tycoon 2")
  3. local b = w:CreateFolder("AutoFarm")
  4. local f = w:CreateFolder("Vehicle")
  5. local g = w:CreateFolder("Character")
  6. local e = w:CreateFolder("Mix")
  7. local u = w:CreateFolder("Credits")
  8. SelectedItemToPlace = ""
  9. Items = {}
  10. for i,v in pairs(game:GetService("ReplicatedStorage").Sellables:GetChildren()) do
  11.     for i,v1 in pairs(v.Variants:GetChildren()) do
  12.         table.insert(Items,v1.Name)
  13.     end
  14. end
  15.  
  16. b:Dropdown("Select Item",Items,true,function(a)
  17.     SelectedItemToPlace = a
  18. end)
  19.    
  20. b:Toggle("Place Item",function(bool)
  21.     shared.toggle = bool
  22.     Place = bool
  23. end)
  24.  
  25. b:Button("Place All Items (Buggy)",function()
  26.     Plot = nil
  27.     for i,v in pairs(game:GetService("Workspace"):GetDescendants()) do
  28.         if v.ClassName == "TextLabel" then
  29.             if tostring(v.Name) == tostring("StoreName") then
  30.                 if tostring(v.Text) == tostring(game:GetService("Players").LocalPlayer.Name.."'s Store") then
  31.                     Plot = v.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name
  32.                 end
  33.             end
  34.         end
  35.     end
  36.     for i,v in pairs(game:GetService("Workspace").Map.Plots[Plot].Objects:GetDescendants()) do
  37.         if string.find(v.Name,"Shelves") then
  38.             for i,v1 in pairs(game:GetService("ReplicatedStorage").Sellables:GetChildren()) do
  39.                 for i,v2 in pairs(v1.Variants:GetChildren()) do
  40.                     pcall(function()
  41.                         game:GetService("ReplicatedStorage").Remotes.StockShelfFunction:InvokeServer(v,tostring(v2.Name))
  42.                     end)
  43.                 end
  44.             end
  45.         end
  46.     end
  47. end)
  48.  
  49. f:Button("Tp Base",function()
  50.     Plot = nil
  51.     for i,v in pairs(game:GetService("Workspace"):GetDescendants()) do
  52.         if v.ClassName == "TextLabel" then
  53.             if tostring(v.Name) == tostring("StoreName") then
  54.                 if tostring(v.Text) == tostring(game:GetService("Players").LocalPlayer.Name.."'s Store") then
  55.                     Plot = v.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name
  56.                 end
  57.             end
  58.         end
  59.     end
  60.     for i,v in pairs(game:GetService("Workspace").PlayerVehicles["Vehicle_"..game:GetService("Players").LocalPlayer.Name]:GetChildren()) do
  61.         if v.ClassName == "MeshPart" or v.ClassName == "Part" then
  62.             v.CFrame = CFrame.new(game:GetService("Workspace").Map.Plots[Plot].Sign.SignBase.CFrame.Position + Vector3.new(-30,10,0))
  63.         end
  64.     end
  65. end)
  66.  
  67. f:Button("Tp Market",function()
  68.     for i,v in pairs(game:GetService("Workspace").PlayerVehicles["Vehicle_"..game:GetService("Players").LocalPlayer.Name]:GetChildren()) do
  69.         if v.ClassName == "MeshPart" or v.ClassName == "Part" then
  70.             for i,v1 in pairs(game:GetService("Workspace").Map.Landmarks["Loading Dock"]:GetDescendants()) do
  71.                 if v1.Name == "Detector" then
  72.                     v.CFrame = CFrame.new(v1.CFrame.Position + Vector3.new(-10,0,0))
  73.                 end
  74.             end
  75.         end
  76.     end
  77. end)
  78.  
  79. f:Button("Unload Truck",function()
  80.     Plot = nil
  81.     for i,v in pairs(game:GetService("Workspace"):GetDescendants()) do
  82.         if v.ClassName == "TextLabel" then
  83.             if tostring(v.Name) == tostring("StoreName") then
  84.                 if tostring(v.Text) == tostring(game:GetService("Players").LocalPlayer.Name.."'s Store") then
  85.                     Plot = v.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name
  86.                 end
  87.             end
  88.         end
  89.     end
  90.     for i,v in pairs(game:GetService("Workspace").PlayerVehicles["Vehicle_"..game:GetService("Players").LocalPlayer.Name]:GetChildren()) do
  91.         if v.ClassName == "MeshPart" or v.ClassName == "Part" then
  92.             for i,v1 in pairs(game:GetService("Workspace").Map.Plots[Plot]:GetDescendants()) do
  93.                 if string.find(v1.Name,"Door") then
  94.                     if v1:FindFirstChild("Base") then
  95.                         spawn(function()
  96.                             v1.Base.CanCollide = false
  97.                             v.CFrame = CFrame.new(v1.Base.CFrame.Position + Vector3.new(0,0,0))
  98.                         end)
  99.                     end
  100.                 end
  101.             end
  102.         end
  103.     end
  104.     wait(1)
  105.     game:GetService("ReplicatedStorage").Remotes.UnloadVehicle:InvokeServer()
  106. end)
  107.  
  108. g:Button("Tp Base",function()
  109.     Plot = nil
  110.     for i,v in pairs(game:GetService("Workspace"):GetDescendants()) do
  111.         if v.ClassName == "TextLabel" then
  112.             if tostring(v.Name) == tostring("StoreName") then
  113.                 if tostring(v.Text) == tostring(game:GetService("Players").LocalPlayer.Name.."'s Store") then
  114.                     Plot = v.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name
  115.                 end
  116.             end
  117.         end
  118.     end
  119.     game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(game:GetService("Workspace").Map.Plots[Plot].Sign.SignBase.CFrame.Position + Vector3.new(-30,10,0))
  120. end)
  121.  
  122. g:Button("Tp Market",function()
  123.     for i,v in pairs(game:GetService("Workspace").Map.Landmarks["Loading Dock"]:GetDescendants()) do
  124.         if v.Name == "Detector" then
  125.             game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(v.CFrame.Position + Vector3.new(0,0,0))
  126.         end
  127.     end
  128. end)
  129.  
  130. e:Toggle("AntiAfk",function(bool)
  131.     shared.toggle = bool
  132.     AntiAfk = bool
  133. end)
  134.  
  135. --Credits
  136. u:Button(game:service("HttpService"):JSONDecode(game:HttpGet("https://raw.githubusercontent.com/Maxgat5/Decode/main/JSON")).username,function()
  137.     setclipboard(game:service("HttpService"):JSONDecode(game:HttpGet("https://raw.githubusercontent.com/Maxgat5/Decode/main/JSON")).username)
  138. end)
  139.  
  140. u:Button("Discord Server",function()
  141.     setclipboard(game:service("HttpService"):JSONDecode(game:HttpGet("https://raw.githubusercontent.com/Maxgat5/Decode/main/JSON")).discord)
  142. end)
  143.  
  144. game:GetService('RunService').Stepped:connect(function()
  145.     spawn(function()
  146.         if AntiAfk == true then
  147.             local bb=game:service'VirtualUser'
  148.             bb:CaptureController()
  149.             bb:ClickButton2(Vector2.new())
  150.         end
  151.     end)
  152. end)
  153.  
  154. while wait() do
  155.     if Place == true then
  156.         Plot = nil
  157.         for i,v in pairs(game:GetService("Workspace"):GetDescendants()) do
  158.             if v.ClassName == "TextLabel" then
  159.                 if tostring(v.Name) == tostring("StoreName") then
  160.                     if tostring(v.Text) == tostring(game:GetService("Players").LocalPlayer.Name.."'s Store") then
  161.                         Plot = v.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name
  162.                     end
  163.                 end
  164.             end
  165.         end
  166.         for i,v in pairs(game:GetService("Workspace").Map.Plots[Plot].Objects:GetDescendants()) do
  167.             if string.find(v.Name,"Shelves") then
  168.                 pcall(function()
  169.                     game:GetService("ReplicatedStorage").Remotes.StockShelfFunction:InvokeServer(v,SelectedItemToPlace)
  170.                 end)
  171.             end
  172.         end
  173.     end
  174. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement