Advertisement
Guest User

Untitled

a guest
Apr 15th, 2022
7,321
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.10 KB | None | 0 0
  1. local debug_mode = true -- Adds debug printing in the console. (Optional)
  2. ---
  3.  
  4. local wally = loadstring(game:HttpGet("https://pastebin.com/raw/nXukuxg3", true))()
  5. local building = wally:CreateWindow('Building')
  6. local units = wally:CreateWindow('Units')
  7. local visuals = wally:CreateWindow("Visuals")
  8. local diplomacy = wally:CreateWindow("Diplomacy")
  9. local settings = wally:CreateWindow("Settings")
  10. local players = game:GetService("Players")
  11. local player = players.LocalPlayer
  12. local gamemanager = workspace.GameManager
  13.  
  14. _G.testingdisabled2 = false
  15.  
  16. local function DebugMsg(msg)
  17. if debug_mode == true then
  18. if msg then
  19. if type(msg) == "string" then
  20. warn("DEBUG: "..msg)
  21. end
  22. end
  23. end
  24. end
  25.  
  26. local suffixes = {"K", "M", "B", "T", "Q", "Qu", "S", "Se", "O", "N", "D"}
  27. local function toSuffixString(n) -- Credit to woot3
  28. for i = #suffixes, 1, -1 do
  29. local v = math.pow(10, i * 3)
  30. if n >= v then
  31. return ("%.0f"):format(n / v) .. suffixes[i]
  32. end
  33. end
  34. return tostring(n)
  35. end
  36.  
  37. local function getcountry()
  38. return player:FindFirstChild("leaderstats").Country.Value
  39. end
  40.  
  41. local mines_required_amount = 1;
  42.  
  43. building:Section("Mines")
  44. local resourceamountreq_mines = building:Slider("Ore Count", {
  45. min = 1;
  46. max = 20;
  47. default = 10;
  48. }, function(v)
  49. mines_required_amount = v;
  50. end)
  51.  
  52. local minebuilding = building:Button('Build Mines', function()
  53. local country = getcountry()
  54. DebugMsg("Build Mines - Initiated")
  55. for i,v in pairs(workspace.Baseplate.Cities:FindFirstChild(country):GetChildren()) do
  56. if not v.Buildings:FindFirstChild("Mine") then
  57. local ores = false
  58. for a,b in pairs(v.Resources:GetChildren()) do
  59. if b.Name == "Oil" or b.Name == "Copper" or b.Name == "Diamond" or b.Name == "Gold" or b.Name == "Iron" or b.Name == "Phosphate" or b.Name == "Tungsten" or b.Name == "Uranium" or b.Name == "Steel" or b.Name == "Titanium" or b.Name == "Chromium" or b.Name == "Aluminum" then
  60. if b.Value >= (mines_required_amount / (10/1)) then
  61. ores = true
  62. end
  63. end
  64. end
  65. wait()
  66. if ores == true then
  67. workspace.GameManager.CreateBuilding:FireServer({[1] = v},"Mines")
  68. DebugMsg("Build Mines - Created mines in "..v.Name)
  69. end
  70. end
  71. end
  72. end)
  73.  
  74. units:Section("Unit Builder")
  75.  
  76. local unitbuilder_amount = 10
  77. local unitbuilder_type = "Infantry"
  78.  
  79. local unitbuilderslider = units:Slider("Unit Count", {
  80. min = 1;
  81. max = 35;
  82. default = 10;
  83.  
  84. }, function(v)
  85. unitbuilder_amount = v;
  86. end)
  87.  
  88. local unitbuilderselector = units:Dropdown("locations", {
  89. list = {
  90. "Infantry";
  91. "Tank";
  92. 'Anti Aircraft';
  93. 'Artillery';
  94. 'Attacker';
  95. 'Bomber';
  96. 'Fighter';
  97. 'Destroyer';
  98. 'Frigate';
  99. 'Battleship';
  100. 'Aircraft Carrier';
  101. 'Submarine';
  102. }
  103. }, function(b)
  104. unitbuilder_type = b
  105. end)
  106.  
  107. local unitbuilder = units:Button('Mass Build Units', function()
  108. local country = getcountry()
  109. DebugMsg("Unit Builder - Initiated")
  110. local cities = {}
  111. for i,v in pairs(workspace.Baseplate.Cities:FindFirstChild(country):GetChildren()) do
  112. if unitbuilder_type == "Bomber" or unitbuilder_type == "Fighter" or unitbuilder_type == "Attacker" then
  113. if v.Buildings:FindFirstChild("Airport") then
  114. table.insert(cities, v)
  115. end
  116. elseif unitbuilder_type == "Submarine" or unitbuilder_type == "Aircraft Carrier" or unitbuilder_type == "Battleship" or unitbuilder_type == "Frigate" then
  117. if v:FindFirstChild("Port") then
  118. table.insert(cities, v)
  119. end
  120. else
  121. table.insert(cities, v)
  122. end
  123. end
  124.  
  125. for i = 1, unitbuilder_amount do
  126. if cities[i] ~= nil then
  127. gamemanager.CreateUnit:FireServer({[1] = cities[i]}, unitbuilder_type)
  128. DebugMsg("Unit Builder - Created a unit at "..cities[i].Name)
  129. else
  130. DebugMsg("Unit Builder - Ran out of cities to build this specific unit at")
  131. end
  132. end
  133. end)
  134.  
  135. local updatetags = false
  136. local tagupdate = 10
  137.  
  138. local alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
  139. local tagname = ""
  140.  
  141. for i = 1, 7 do
  142. local random = math.random(1, #alphabet)
  143. tagname = tagname..string.sub(alphabet, random, random)
  144. end
  145.  
  146. local faketag = Instance.new("BillboardGui")
  147. faketag.Name = tagname
  148. faketag.Size = UDim2.new(1,0,1,0)
  149. faketag.Enabled = true
  150. faketag.AlwaysOnTop = true
  151. faketag.MaxDistance = 20
  152. local faketaglabel = Instance.new("TextLabel")
  153. faketaglabel.Parent = faketag
  154. faketaglabel.BackgroundTransparency = 1
  155. faketaglabel.TextColor3 = Color3.fromRGB(255, 0, 0)
  156. faketaglabel.Text = "nil?"
  157. faketaglabel.Font = Enum.Font.Code
  158. faketaglabel.TextSize = 20
  159.  
  160. visuals:Section("Units")
  161. local slider = visuals:Slider("Unit Update", {
  162. min = 1;
  163. max = 60;
  164. default = 10
  165. --flag = 'fov'
  166. }, function(v)
  167. tagupdate = v;
  168. end)
  169.  
  170. local unitvisuals = visuals:Button('Global Unit Visualization', function()
  171. if updatetags == false then
  172. updatetags = true
  173. DebugMsg("Global Unit Visualization - Enabled")
  174. for i,v in pairs(workspace.Units:GetChildren()) do
  175. if not v:FindFirstChild(tagname) then
  176. if v:FindFirstChild("Current") and v:FindFirstChild("Type") then
  177. local tagbro = faketag:Clone()
  178. tagbro.Parent = v
  179. tagbro.Adornee = v
  180. tagbro.TextLabel.Text = tostring(v.Type.Value).." - "..toSuffixString(v.Current.Value)
  181. tagbro.TextLabel:TweenSize(UDim2.new(0,600,0,200))
  182. if v.Owner.Value == player.Name then
  183. tagbro.TextLabel.TextColor3 = Color3.fromRGB(0, 255, 0)
  184. end
  185. end
  186. elseif v:FindFirstChild(tagname) then
  187. v:FindFirstChild(tagname).Enabled = true
  188. end
  189. end
  190. else
  191. updatetags = false
  192. DebugMsg("Global Unit Visualization - Disabled")
  193. for i,v in pairs(workspace.Units:GetChildren()) do
  194. if v:FindFirstChild(tagname) then
  195. v:FindFirstChild(tagname).Enabled = false
  196. end
  197. end
  198. end
  199. end)
  200.  
  201. workspace.Units.ChildAdded:Connect(function(child)
  202. if updatetags == true then
  203. if child:IsA("Part") then
  204. if child ~= nil then
  205. if child:FindFirstChild("Current") and v:FindFirstChild("Type") then
  206. local tagbro = faketag:Clone()
  207. tagbro.Parent = v
  208. tagbro.Adornee = v
  209. tagbro.TextLabel.Text = tostring(v.Type.Value).." - "..toSuffixString(v.Current.Value)
  210. tagbro.TextLabel:TweenSize(UDim2.new(0,600,0,200))
  211. if v.Owner.Value == player.Name then
  212. tagbro.TextLabel.TextColor3 = Color3.fromRGB(0, 255, 0)
  213. end
  214. end
  215. end
  216. end
  217. end
  218. end)
  219.  
  220. diplomacy:Section("Spam Alliance")
  221.  
  222. local function checkcountryexists(arg)
  223. for i,v in pairs(players:GetPlayers()) do
  224. if v:FindFirstChild("leaderstats") then
  225. if v.leaderstats.Country.Value ~= nil then
  226. return true
  227. end
  228. else
  229. return false
  230. end
  231. end
  232. wait()
  233. return false
  234. end
  235.  
  236. local spamcountries = {}
  237. local selected_spamcountry;
  238.  
  239. local box = diplomacy:Box('Country', {
  240. type = 'string';
  241. }, function(new)
  242. selected_spamcountry = new
  243. end)
  244.  
  245. local spamcountries_yes = diplomacy:Button('Enable', function()
  246. if selected_spamcountry ~= nil then
  247. local exists = checkcountryexists(selected_spamcountry)
  248. if exists == true then
  249. spamcountries[selected_spamcountry] = true
  250. DebugMsg("Spam Alliance - Added spam alliance on "..selected_spamcountry)
  251. end
  252. end
  253. end)
  254.  
  255. local spamcountries_no = diplomacy:Button('Disable', function()
  256. if spamcountries[selected_spamcountry] ~= nil then
  257. spamcountries[selected_spamcountry] = nil
  258. DebugMsg("Spam Alliance - Removed spam alliance on "..selected_spamcountry)
  259. end
  260. end)
  261.  
  262. gamemanager.AlertPopup.OnClientEvent:Connect(function(a, b)
  263. if a == "Alliance declined" then
  264. if string.gsub(b, " has refused to join our alliance!", "") ~= nil then
  265. if spamcountries[string.gsub(b, " has refused to join our alliance!", "")] ~= nil then
  266. delay(60, function()
  267. gamemanager.ManageAlliance:FireServer(string.gsub(b, " has refused to join our alliance!", ""), "SendRequest")
  268. DebugMsg("Spam Alliance - Sent ally request to "..string.gsub(b, " has refused to join our alliance!", ""))
  269. end)
  270. end
  271. else
  272. DebugMsg("Spam Alliance - Country value returned as nil, data: "..b)
  273. end
  274. elseif a == "Alliance Accepted" then
  275. if string.gsub(b, " has accepted our offer of an alliance.", "") ~= nil then
  276. if spamcountries[string.gsub(b, " has accepted our offer of an alliance.", "")] then
  277. spamcountries[string.gsub(b, " has accepted our offer of an alliance.", "")] = nil
  278. end
  279. else
  280. DebugMsg("Spam Alliance - Country value returned as nil, data: "..b)
  281. end
  282. end
  283. end)
  284.  
  285. settings:Section("Debug Info")
  286.  
  287. local minebuilding = settings:Button('Toggle Debug Mode', function()
  288. debug_mode = not debug_mode
  289. DebugMsg("Debug Mode Settings - Toggled")
  290. end)
  291.  
  292. spawn(function()
  293. while wait(tagupdate) do
  294. if _G.testingdisabled2 == true then
  295. break
  296. end
  297. if updatetags == true then
  298. DebugMsg("Global Unit Visualization - Updated")
  299. for i,v in pairs(workspace.Units:GetChildren()) do
  300. if v:FindFirstChild(tagname) and v:FindFirstChild("Current") and v:FindFirstChild("Type") then
  301. v:FindFirstChild(tagname).TextLabel.Text = tostring(v.Type.Value).." - "..toSuffixString(v.Current.Value)
  302. end
  303. end
  304. end
  305. end
  306. end)
  307.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement