Advertisement
FurkingBoi

Army Tycoon

Jan 29th, 2020
15,318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.37 KB | None | 0 0
  1. -- Gui to Lua
  2. -- Version: 3
  3.  
  4. -- Instances:
  5.  
  6. local ScreenGui = Instance.new("ScreenGui")
  7. local Frame = Instance.new("Frame")
  8. local TextLabel = Instance.new("TextLabel")
  9. local TextButton = Instance.new("TextButton")
  10. local TextButton_2 = Instance.new("TextButton")
  11. local TextButton_3 = Instance.new("TextButton")
  12. local TextButton_4 = Instance.new("TextButton")
  13. local TextButton_5 = Instance.new("TextButton")
  14. local TextButton_6 = Instance.new("TextButton")
  15. local Frame_2 = Instance.new("Frame")
  16. local TextButton_7 = Instance.new("TextButton")
  17.  
  18. --Properties:
  19.  
  20. ScreenGui.Parent = game.CoreGui
  21.  
  22. Frame.Parent = ScreenGui
  23. Frame.BackgroundColor3 = Color3.new(0, 0, 0)
  24. Frame.Position = UDim2.new(0.0788844526, 0, 0.54004848, 0)
  25. Frame.Size = UDim2.new(0, 297, 0, 274)
  26. Frame.Visible = false
  27. Frame.Active = true
  28. Frame.Draggable = true
  29.  
  30. TextLabel.Parent = Frame
  31. TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  32. TextLabel.Size = UDim2.new(0, 297, 0, 23)
  33. TextLabel.Font = Enum.Font.GothamBlack
  34. TextLabel.Text = "Army Tycoon GUI"
  35. TextLabel.TextColor3 = Color3.new(0, 0, 0)
  36. TextLabel.TextSize = 20
  37.  
  38. TextButton.Parent = Frame
  39. TextButton.BackgroundColor3 = Color3.new(1, 1, 1)
  40. TextButton.Position = UDim2.new(0.0370370448, 0, 0.145985395, 0)
  41. TextButton.Size = UDim2.new(0, 124, 0, 50)
  42. TextButton.Font = Enum.Font.SourceSans
  43. TextButton.Text = "Kill All Units"
  44. TextButton.TextColor3 = Color3.new(0, 0, 0)
  45. TextButton.TextSize = 14
  46. TextButton.MouseButton1Down:connect(function()
  47. for i,v in pairs(game.Workspace.Game.Units:GetChildren()) do
  48. if v.Name == game.Players.LocalPlayer.Name then
  49. else
  50. for i,v2 in pairs(v:GetChildren()) do
  51. local Missile = "Cruise Missile"
  52. local Position = v2.Torso.Position
  53. game:GetService("ReplicatedStorage").RE.FireMissile:FireServer(Missile, Position)
  54. end
  55. end
  56. end
  57. end)
  58.  
  59. TextButton_2.Parent = Frame
  60. TextButton_2.BackgroundColor3 = Color3.new(1, 1, 1)
  61. TextButton_2.Position = UDim2.new(0.508417487, 0, 0.145985395, 0)
  62. TextButton_2.Size = UDim2.new(0, 124, 0, 50)
  63. TextButton_2.Font = Enum.Font.SourceSans
  64. TextButton_2.Text = "Get All Buildings"
  65. TextButton_2.TextColor3 = Color3.new(0, 0, 0)
  66. TextButton_2.TextSize = 14
  67. TextButton_2.MouseButton1Down:connect(function()
  68. for i,v in pairs(game.Workspace.Game.Buttons:GetChildren()) do
  69. if v.Name == game.Players.LocalPlayer.Name then
  70. for i,v2 in pairs(v:GetChildren()) do
  71. game:GetService("ReplicatedStorage").RE.relinquish:FireServer(v2, true)
  72. end
  73. end
  74. end
  75.  
  76. for i,v in pairs(game.Workspace.Game.Buttons:GetChildren()) do
  77. if v.Name == game.Players.LocalPlayer.Name then
  78. for i,v2 in pairs(v:GetChildren()) do
  79. for i,v3 in pairs(v2:GetChildren()) do
  80. if v3:IsA("ObjectValue") then
  81. v3.Name = v3.Value.Name
  82. end
  83. end
  84. end
  85. end
  86. end
  87.  
  88.  
  89. for i,v in pairs(game.Workspace.Game.Buttons:GetChildren()) do
  90. if v.Name == game.Players.LocalPlayer.Name then
  91. for i,v2 in pairs(v:GetChildren()) do
  92. for i,v3 in pairs(v2:GetChildren()) do
  93. if v3:IsA("ObjectValue") then
  94. if v3.Name == "Barracks" then
  95. local Class = game.ReplicatedStorage.Game.Buildings["Barracks"]["2"];
  96. local Button = v2;
  97. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  98. Target:FireServer(Class, Button);
  99. else
  100. if v3.Name == "Greenhouse" then
  101. local Class = game.ReplicatedStorage.Game.Buildings["Greenhouse"]["2"];
  102. local Button = v2;
  103. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  104. Target:FireServer(Class, Button);
  105. else
  106. if v3.Name == "Factory" then
  107. local Class = game.ReplicatedStorage.Game.Buildings["Factory"]["3"];
  108. local Button = v2;
  109. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  110. Target:FireServer(Class, Button);
  111. else
  112. if v3.Name == "Oil Field" then
  113. local Class = game.ReplicatedStorage.Game.Buildings["Oil Field"]["2"];
  114. local Button = v2;
  115. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  116. Target:FireServer(Class, Button);
  117. else
  118. if v3.Name == "Guard Tower" then
  119. local Class = game.ReplicatedStorage.Game.Buildings["Guard Tower"]["1"];
  120. local Button = v2;
  121. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  122. Target:FireServer(Class, Button);
  123. else
  124. if v3.Name == "Wall" then
  125. local Class = game.ReplicatedStorage.Game.Buildings["Wall"]["2"];
  126. local Button = v2;
  127. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  128. Target:FireServer(Class, Button);
  129. else
  130. if v3.Name == "Generator Powerplant" then
  131. local Class = game.ReplicatedStorage.Game.Buildings["Generator Powerplant"]["1"];
  132. local Button = v2;
  133. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  134. Target:FireServer(Class, Button);
  135. else
  136. if v3.Name == "Missile Factory" then
  137. local Class = game.ReplicatedStorage.Game.Buildings["Missile Factory"]["1"];
  138. local Button = v2;
  139. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  140. Target:FireServer(Class, Button);
  141. else
  142. if v3.Name == "Command Center" then
  143. local Class = game.ReplicatedStorage.Game.Buildings["Command Center"]["2"];
  144. local Button = v2;
  145. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  146. Target:FireServer(Class, Button);
  147. else
  148. if v3.Name == "Drone Factory" then
  149. local Class = game.ReplicatedStorage.Game.Buildings["Drone Factory"]["1"];
  150. local Button = v2;
  151. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  152. Target:FireServer(Class, Button);
  153. else
  154. if v3.Name == "Military" then
  155. local Class = game.ReplicatedStorage.Game.Buildings.Military["Tank Factory"]["2"];
  156. local Button = v2;
  157. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  158. Target:FireServer(Class, Button);
  159. else
  160. if v3.Name == "Nuclear Powerplant" then
  161. local Class = game.ReplicatedStorage.Game.Buildings["Nuclear Powerplant"]["1"];
  162. local Button = v2;
  163. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  164. Target:FireServer(Class, Button);
  165. else
  166. if v3.Name == "Airport" then
  167. local Class = game.ReplicatedStorage.Game.Buildings["Airport"]["1"];
  168. local Button = v2;
  169. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  170. Target:FireServer(Class, Button);
  171. else
  172. if v3.Name == "Helicopter Bay" then
  173. local Class = game.ReplicatedStorage.Game.Buildings["Helicopter Bay"]["2"];
  174. local Button = v2;
  175. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  176. Target:FireServer(Class, Button);
  177. else
  178. if v3.Name == "Main Base" then
  179. local Class = game.ReplicatedStorage.Game.Buildings["Main Base"]["2"];
  180. local Button = v2;
  181. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  182. Target:FireServer(Class, Button);
  183. end
  184. end
  185. end
  186. end
  187. end
  188. end
  189. end
  190. end
  191. end
  192. end
  193. end
  194. end
  195. end
  196. end
  197. end
  198. end
  199. end
  200. end
  201. end
  202. end
  203. end)
  204.  
  205. TextButton_3.Parent = Frame
  206. TextButton_3.BackgroundColor3 = Color3.new(1, 1, 1)
  207. TextButton_3.Position = UDim2.new(0.0370370448, 0, 0.434306532, 0)
  208. TextButton_3.Size = UDim2.new(0, 124, 0, 50)
  209. TextButton_3.Font = Enum.Font.SourceSans
  210. TextButton_3.Text = "Give All Players All Buildings"
  211. TextButton_3.TextColor3 = Color3.new(0, 0, 0)
  212. TextButton_3.TextSize = 14
  213. TextButton_3.TextScaled = true
  214. TextButton_3.MouseButton1Down:connect(function()
  215. for i,v in pairs(game.Workspace.Game.Buttons:GetChildren()) do
  216. if v.Name == game.Players.LocalPlayer.Name then
  217. for i,v2 in pairs(v:GetChildren()) do
  218. game:GetService("ReplicatedStorage").RE.relinquish:FireServer(v2, true)
  219. end
  220. end
  221. end
  222.  
  223. for i,v in pairs(game.Workspace.Game.Buttons:GetChildren()) do
  224. if v.Name == game.Players.LocalPlayer.Name then
  225. for i,v2 in pairs(v:GetChildren()) do
  226. for i,v3 in pairs(v2:GetChildren()) do
  227. if v3:IsA("ObjectValue") then
  228. v3.Name = v3.Value.Name
  229. end
  230. end
  231. end
  232. end
  233. end
  234.  
  235.  
  236. for i,v in pairs(game.Workspace.Game.Buttons:GetChildren()) do
  237. if v.Name == game.Players.LocalPlayer.Name then
  238. for i,v2 in pairs(v:GetChildren()) do
  239. for i,v3 in pairs(v2:GetChildren()) do
  240. if v3:IsA("ObjectValue") then
  241. if v3.Name == "Barracks" then
  242. local Class = game.ReplicatedStorage.Game.Buildings["Barracks"]["2"];
  243. local Button = v2;
  244. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  245. Target:FireServer(Class, Button);
  246. else
  247. if v3.Name == "Greenhouse" then
  248. local Class = game.ReplicatedStorage.Game.Buildings["Greenhouse"]["2"];
  249. local Button = v2;
  250. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  251. Target:FireServer(Class, Button);
  252. else
  253. if v3.Name == "Factory" then
  254. local Class = game.ReplicatedStorage.Game.Buildings["Factory"]["3"];
  255. local Button = v2;
  256. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  257. Target:FireServer(Class, Button);
  258. else
  259. if v3.Name == "Oil Field" then
  260. local Class = game.ReplicatedStorage.Game.Buildings["Oil Field"]["2"];
  261. local Button = v2;
  262. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  263. Target:FireServer(Class, Button);
  264. else
  265. if v3.Name == "Guard Tower" then
  266. local Class = game.ReplicatedStorage.Game.Buildings["Guard Tower"]["1"];
  267. local Button = v2;
  268. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  269. Target:FireServer(Class, Button);
  270. else
  271. if v3.Name == "Wall" then
  272. local Class = game.ReplicatedStorage.Game.Buildings["Wall"]["2"];
  273. local Button = v2;
  274. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  275. Target:FireServer(Class, Button);
  276. else
  277. if v3.Name == "Generator Powerplant" then
  278. local Class = game.ReplicatedStorage.Game.Buildings["Generator Powerplant"]["1"];
  279. local Button = v2;
  280. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  281. Target:FireServer(Class, Button);
  282. else
  283. if v3.Name == "Missile Factory" then
  284. local Class = game.ReplicatedStorage.Game.Buildings["Missile Factory"]["1"];
  285. local Button = v2;
  286. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  287. Target:FireServer(Class, Button);
  288. else
  289. if v3.Name == "Command Center" then
  290. local Class = game.ReplicatedStorage.Game.Buildings["Command Center"]["2"];
  291. local Button = v2;
  292. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  293. Target:FireServer(Class, Button);
  294. else
  295. if v3.Name == "Drone Factory" then
  296. local Class = game.ReplicatedStorage.Game.Buildings["Drone Factory"]["1"];
  297. local Button = v2;
  298. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  299. Target:FireServer(Class, Button);
  300. else
  301. if v3.Name == "Military" then
  302. local Class = game.ReplicatedStorage.Game.Buildings.Military["Tank Factory"]["2"];
  303. local Button = v2;
  304. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  305. Target:FireServer(Class, Button);
  306. else
  307. if v3.Name == "Nuclear Powerplant" then
  308. local Class = game.ReplicatedStorage.Game.Buildings["Nuclear Powerplant"]["1"];
  309. local Button = v2;
  310. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  311. Target:FireServer(Class, Button);
  312. else
  313. if v3.Name == "Airport" then
  314. local Class = game.ReplicatedStorage.Game.Buildings["Airport"]["1"];
  315. local Button = v2;
  316. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  317. Target:FireServer(Class, Button);
  318. else
  319. if v3.Name == "Helicopter Bay" then
  320. local Class = game.ReplicatedStorage.Game.Buildings["Helicopter Bay"]["2"];
  321. local Button = v2;
  322. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  323. Target:FireServer(Class, Button);
  324. else
  325. if v3.Name == "Main Base" then
  326. local Class = game.ReplicatedStorage.Game.Buildings["Main Base"]["2"];
  327. local Button = v2;
  328. local Target = game:GetService("ReplicatedStorage").RE.insertBuilding;
  329. Target:FireServer(Class, Button);
  330. end
  331. end
  332. end
  333. end
  334. end
  335. end
  336. end
  337. end
  338. end
  339. end
  340. end
  341. end
  342. end
  343. end
  344. end
  345. end
  346. end
  347. end
  348. end
  349. end
  350. end)
  351.  
  352. TextButton_4.Parent = Frame
  353. TextButton_4.BackgroundColor3 = Color3.new(1, 1, 1)
  354. TextButton_4.Position = UDim2.new(0.0370370448, 0, 0.708029211, 0)
  355. TextButton_4.Size = UDim2.new(0, 124, 0, 50)
  356. TextButton_4.Font = Enum.Font.SourceSans
  357. TextButton_4.Text = "Lag Players"
  358. TextButton_4.TextColor3 = Color3.new(0, 0, 0)
  359. TextButton_4.TextSize = 14
  360. TextButton_4.MouseButton1Down:connect(function()
  361. while wait() do
  362. for i,v in pairs(game.Players:GetChildren()) do
  363. targetPos = v.Character.HumanoidRootPart.Position
  364. game.ReplicatedStorage.RE.FireMissile:FireServer("Nuke",targetPos)
  365. end
  366. end
  367. end)
  368.  
  369. TextButton_5.Parent = Frame
  370. TextButton_5.BackgroundColor3 = Color3.new(1, 1, 1)
  371. TextButton_5.Position = UDim2.new(0.508417487, 0, 0.434306532, 0)
  372. TextButton_5.Size = UDim2.new(0, 124, 0, 50)
  373. TextButton_5.Font = Enum.Font.SourceSans
  374. TextButton_5.Text = "Send Nuke To Mouse (Q)"
  375. TextButton_5.TextColor3 = Color3.new(0, 0, 0)
  376. TextButton_5.TextSize = 14
  377. TextButton_5.TextScaled = true
  378. TextButton_5.MouseButton1Down:connect(function()
  379. local mouse = game:service'Players'.LocalPlayer:GetMouse()
  380.  
  381. mouse.KeyDown:Connect(function(k)
  382. if k == "q" then
  383. game:GetService("ReplicatedStorage").RE.FireMissile:FireServer("Nuke",Vector3.new(mouse.Hit.p.X,48.6649132,mouse.Hit.p.Z))
  384. end
  385. end)
  386. end)
  387.  
  388. TextButton_6.Parent = Frame
  389. TextButton_6.BackgroundColor3 = Color3.new(1, 0, 0)
  390. TextButton_6.Position = UDim2.new(0.92592591, 0, 0, 0)
  391. TextButton_6.Size = UDim2.new(0, 22, 0, 23)
  392. TextButton_6.Font = Enum.Font.GothamBold
  393. TextButton_6.Text = "X"
  394. TextButton_6.TextColor3 = Color3.new(0, 0, 0)
  395. TextButton_6.TextSize = 28
  396. TextButton_6.MouseButton1Down:connect(function()
  397. Frame.Visible = false
  398. Frame_2.Visible = true
  399. end)
  400.  
  401. Frame_2.Parent = ScreenGui
  402. Frame_2.BackgroundColor3 = Color3.new(1, 1, 1)
  403. Frame_2.Position = UDim2.new(0.00717131514, 0, 0.444174707, 0)
  404. Frame_2.Size = UDim2.new(0, 91, 0, 28)
  405. Frame.Active = true
  406. Frame.Draggable = true
  407.  
  408.  
  409. TextButton_7.Parent = Frame_2
  410. TextButton_7.BackgroundColor3 = Color3.new(1, 1, 1)
  411. TextButton_7.Position = UDim2.new(0, 0, 0.0357142873, 0)
  412. TextButton_7.Size = UDim2.new(0, 190, 0, 260)
  413. TextButton_7.Font = Enum.Font.SourceSans
  414. TextButton_7.Text = "Open"
  415. TextButton_7.TextColor3 = Color3.new(0, 0, 0)
  416. TextButton_7.TextSize = 14
  417. TextButton_7.MouseButton1Down:connect(function()
  418. Frame_2.Visible = false
  419. Frame.Visible = true
  420. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement