Advertisement
AtlasLoader

Untitled

Jan 20th, 2025
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.61 KB | None | 0 0
  1. repeat
  2. wait(1)
  3. until game:IsLoaded()
  4.  
  5. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  6. local Players = game:GetService("Players")
  7. local Me = Players.LocalPlayer
  8. local MultiboxFramework = require(ReplicatedStorage:WaitForChild("MultiboxFramework"))
  9. local IsLobby = ReplicatedStorage:FindFirstChild("IsLobby")
  10.  
  11. local SETTINGS = {
  12. Debug = false, -- Print in console every action of bot
  13. FarmCoins = true, -- enables auto teleport in lobby to start game
  14. SoloFarm = true, -- start only solo games
  15. AutoPlayMap = "ToiletCity", -- ToiletCity Desert CameramanHQ
  16. AutoSkip = true, -- skip waves
  17. RemoveDecorations = true, -- visual remove decorations in game for placing units everywhere
  18. RemoveAttackers = true, -- visual remove enemies (just for fps boost)
  19. BuildDeckMode = false, -- enables build deck mode (line 477) works only if FarmCoins = false
  20. WalkToSpawnedUnit = false, -- makes player will move to place unit position
  21. }
  22.  
  23. if SETTINGS.FarmCoins and IsLobby and IsLobby.Value then
  24. while true do
  25. for k, v in pairs(Workspace.Lifts:GetChildren()) do
  26. local counterCondition = v.Base.StatusGui.PlayersCount.Text == "0/5"
  27. if not SETTINGS.SoloFarm then
  28. counterCondition = v.Base.StatusGui.PlayersCount.Text ~= "0/5"
  29. end
  30.  
  31. if v.Name == SETTINGS.AutoPlayMap and counterCondition then
  32.  
  33. Me.Character.PrimaryPart.CFrame = v.Base.CFrame + Vector3.new(0, 0.5, 0)
  34.  
  35. if SETTINGS.SoloFarm then
  36. Me.PlayerGui.Lobby.QueueFrame.Size = UDim2.new(1.1, 0, 1.1, 0)
  37. Me.PlayerGui.Lobby.QueueFrame.Position = UDim2.new(-0.1, 0, -0.1, 0)
  38. Me.PlayerGui.Lobby.QueueFrame.Start.Size = UDim2.new(1, 0, 1, 0)
  39. Me.PlayerGui.Lobby.QueueFrame.Start.Position = UDim2.new(0, 0, 0, 0)
  40.  
  41. mousemoveabs(1, 1)
  42. wait(0.1)
  43. mousemoveabs(1, 1)
  44. wait(0.1)
  45. mousemoverel(1, 1)
  46. wait(0.1)
  47. mousemoverel(1, 1)
  48. wait(0.1)
  49. mouse1click()
  50. wait(0.1)
  51. mouse1click()
  52. wait(0.1)
  53. mouse1click()
  54. end
  55. wait(4)
  56. end
  57. end
  58. wait(0.1)
  59. end
  60. end
  61.  
  62. if IsLobby and not IsLobby.Value then
  63. repeat
  64. wait(0.1)
  65. until MultiboxFramework and MultiboxFramework.SharedSettings
  66.  
  67. local CanSkip = ReplicatedStorage.MatchData.CanSkip
  68. local CurrentWave = ReplicatedStorage.MatchData.CurrentWave
  69. local MatchTimer = ReplicatedStorage.MatchData.MatchTimer
  70. local MapId = ReplicatedStorage.MatchData.MapId
  71. local Money = Me.leaderstats.Money
  72.  
  73. local PlacedUnits = {}
  74. local LastUnitSpawned = nil
  75. local LastUnitRemoved = nil
  76. local SpawningUnit = nil
  77.  
  78.  
  79. local packetsFolder = ReplicatedStorage.AutoSerde:GetChildren()
  80. local PACKETS = {
  81. SKIP_WAVE = packetsFolder[#packetsFolder - 2].Value,
  82. SPAWN_UNIT = packetsFolder[#packetsFolder - 14].Value,
  83. UPGRADE_UNIT = packetsFolder[#packetsFolder - 7].Value,
  84. SELL_UNIT = packetsFolder[#packetsFolder - 6].Value,
  85. }
  86.  
  87. local BUILDS = {
  88. ["ToiletCity"] = {
  89. { "place", "NinjaCameraman1", "NinjaCameraman", -69.43, 2.5, -84.25, 1 },
  90. { "upgrade", "NinjaCameraman1", 3 },
  91. { "place", "TitanSpeakerman2", "TitanSpeakerman", -78, 8.48, -84.3, 1 },
  92. { "upgrade", "TitanSpeakerman2", 5 },
  93. { "place", "TitanSpeakerman3", "TitanSpeakerman", -77.8, 8.48, -97, 1 },
  94. { "upgrade", "TitanSpeakerman3", 5 },
  95. { "place", "TitanSpeakerman4", "TitanSpeakerman", -66.6, 8.48, -96.6, 1 },
  96. { "upgrade", "TitanSpeakerman4", 5 },
  97. { "place", "TitanSpeakerman5", "TitanSpeakerman", -53.27, 8.48, -46.17, 1 },
  98. { "upgrade", "TitanSpeakerman5", 5 },
  99. { "place", "TitanSpeakerman6", "TitanSpeakerman", -39.58, 8.48, -45.43, 1 },
  100. { "upgrade", "TitanSpeakerman6", 5 },
  101. { "place", "TitanSpeakerman7", "TitanSpeakerman", -23.92, 8.48, -45.09, 1 },
  102. { "upgrade", "TitanSpeakerman7", 5 },
  103. { "place", "TitanSpeakerman8", "TitanSpeakerman", -44.55, 8.48, -25.02, 1 },
  104. { "upgrade", "TitanSpeakerman8", 5 },
  105. { "place", "TitanSpeakerman9", "TitanSpeakerman", -63.44, 8.48, -28.68, 1 },
  106. { "upgrade", "TitanSpeakerman9", 5 },
  107. { "place", "TitanSpeakerman10", "TitanSpeakerman", -80.89, 8.48, -29.06, 1 },
  108. { "upgrade", "TitanSpeakerman10", 5 },
  109. { "place", "TitanSpeakerman11", "TitanSpeakerman", -43.43, 8.48, -10.81, 1 },
  110. { "upgrade", "TitanSpeakerman11", 5 },
  111. },
  112. ["Desert"] = {
  113. { "place", "TVMan1", "TVMan", -68.75, 2.68, -86.65, 1 },
  114. { "place", "ScientistCameraman2", "ScientistCameraman", -103.51, 2.50, -92.30, 1 },
  115. { "place", "NinjaCameraman3", "NinjaCameraman", -71.29, 2.50, -37.53, 1 },
  116. { "place", "ScientistCameraman4", "ScientistCameraman", -103.56, 2.50, -91.11, 1 },
  117. { "place", "ScientistCameraman5", "ScientistCameraman", -103.70, 2.50, -89.91, 1 },
  118. { "place", "ScientistCameraman6", "ScientistCameraman", -103.81, 2.50, -88.26, 1 },
  119. { "upgrade", "TVMan1", 3 },
  120. { "upgrade", "NinjaCameraman3", 4 },
  121. { "upgrade", "ScientistCameraman2", 2 },
  122. { "upgrade", "ScientistCameraman4", 2 },
  123. { "place", "TitanSpeakerman7", "TitanSpeakerman", -75.44, 8.48, -47.71, 1 },
  124. { "upgrade", "TitanSpeakerman7", 5 },
  125. { "upgrade", "ScientistCameraman5", 2 },
  126. { "upgrade", "ScientistCameraman6", 2 },
  127. { "place", "TitanSpeakerman8", "TitanSpeakerman", -32.89, 8.48, -46.21, 1 },
  128. { "upgrade", "TitanSpeakerman8", 5 },
  129. { "place", "TitanSpeakerman9", "TitanSpeakerman", -71.35, 8.48, -6.94, 1 },
  130. { "upgrade", "TitanSpeakerman9", 5 },
  131. { "place", "TitanTVMan10", "TitanTVMan", -91.41, 8.39, -73.60, 1 },
  132. { "upgrade", "TitanTVMan10", 6 },
  133. { "sell", "TVMan1" },
  134. { "sell", "NinjaCameraman3" },
  135. { "sell", "ScientistCameraman2" },
  136. { "sell", "ScientistCameraman4" },
  137. { "sell", "ScientistCameraman5" },
  138. { "sell", "ScientistCameraman6" },
  139. { "place", "TitanTVMan11", "TitanTVMan", -54.95, 8.39, -49.11, 1 },
  140. { "upgrade", "TitanTVMan11", 6 },
  141. { "place", "TitanTVMan12", "TitanTVMan", -59.42, 8.39, -7.41, 1 },
  142. { "upgrade", "TitanTVMan12", 6 },
  143. { "place", "TitanTVMan13", "TitanTVMan", -44.20, 8.39, -84.38, 1 },
  144. { "upgrade", "TitanTVMan13", 6 },
  145. { "place", "TitanTVMan14", "TitanTVMan", -36.48, 8.39, -67.53, 1 },
  146. { "upgrade", "TitanTVMan14", 6 },
  147. { "place", "TitanTVMan15", "TitanTVMan", -18.16, 8.39, -67.47, 1 },
  148. { "upgrade", "TitanTVMan15", 6 },
  149. { "place", "TitanTVMan16", "TitanTVMan", -15.34, 8.39, -45.78, 1 },
  150. { "upgrade", "TitanTVMan16", 6 },
  151. { "place", "TitanSpeakerman17", "TitanSpeakerman", -38.20, 8.48, -94.52, 1 },
  152. { "upgrade", "TitanSpeakerman17", 5 },
  153. { "place", "TitanSpeakerman18", "TitanSpeakerman", -37.43, 8.48, -85.74, 1 },
  154. { "upgrade", "TitanSpeakerman18", 5 },
  155. },
  156. ["CameramanHQ"] = {
  157. { "place", "ScientistCameraman1", "ScientistCameraman", 22, 2.3, -96, 1 },
  158. { "place", "ScientistCameraman2", "ScientistCameraman", 32, 2.3, -96, 1 },
  159. { "place", "TVMan1", "TVMan", 32.9, 2.5, -85, 1 },
  160. { "place", "NinjaCameraman1", "NinjaCameraman", -29, 2.3, -34, 1 },
  161. { "place", "ScientistCameraman3", "ScientistCameraman", 42, 2.3, -96, 1 },
  162. { "place", "ScientistCameraman4", "ScientistCameraman", 52, 2.3, -96, 1 },
  163. { "upgrade", "TVMan1", 2 },
  164. { "upgrade", "NinjaCameraman1", 2 },
  165. { "upgrade", "TVMan1", 3 },
  166. { "upgrade", "ScientistCameraman1", 2 },
  167. { "upgrade", "ScientistCameraman3", 2 },
  168. { "upgrade", "ScientistCameraman2", 2 },
  169. { "upgrade", "ScientistCameraman4", 2 },
  170. { "place", "TitanSpeakerman1", "TitanSpeakerman", -6, 8.2, -20, 1 },
  171. { "upgrade", "TitanSpeakerman1", 5 },
  172. { "place", "TitanSpeakerman2", "TitanSpeakerman", -16.3, 8.2, -20.3, 1 },
  173. { "upgrade", "TitanSpeakerman2", 5 },
  174. { "place", "TitanSpeakerman3", "TitanSpeakerman", -9.8, 8.2, -71, 3 },
  175. { "upgrade", "TitanSpeakerman3", 5 },
  176. { "place", "TitanTVMan1", "TitanTVMan", 25.7, 8.2, -67.2, 3 },
  177. { "upgrade", "TitanTVMan1", 6 },
  178. { "place", "TitanSpeakerman4", "TitanSpeakerman", -6.3, 8.2, -11.6, 5 },
  179. { "upgrade", "TitanSpeakerman4", 5 },
  180. { "sell", "ScientistCameraman1" },
  181. { "sell", "ScientistCameraman2" },
  182. { "sell", "ScientistCameraman3" },
  183. { "sell", "ScientistCameraman4" },
  184. { "sell", "TVMan1" },
  185. { "sell", "NinjaCameraman1" },
  186. { "place", "TitanSpeakerman5", "TitanSpeakerman", -9, 8.2, -62.7, 5 },
  187. { "upgrade", "TitanSpeakerman5", 5 },
  188. { "place", "TitanTVMan2", "TitanTVMan", -17.5, 8.2, -66.7, 7 },
  189. { "upgrade", "TitanTVMan2", 6 },
  190. { "place", "TitanTVMan3", "TitanTVMan", 17.0, 8.2, -67.1, 7 },
  191. { "upgrade", "TitanTVMan3", 6 },
  192. { "place", "TitanTVMan4", "TitanTVMan", 8.5, 8.2, -67.5, 7 },
  193. { "upgrade", "TitanTVMan4", 6 },
  194. { "place", "TitanTVMan5", "TitanTVMan", -1.4, 8.2, -34.1, 1 },
  195. { "upgrade", "TitanTVMan5", 6 },
  196. { "place", "TitanTVMan6", "TitanTVMan", -12.2, 8.2, -34.2, 1 },
  197. { "upgrade", "TitanTVMan6", 6 },
  198. { "place", "TitanTVMan7", "TitanTVMan", -21.1, 8.2, -33.7, 3 },
  199. { "upgrade", "TitanTVMan7", 6 },
  200. { "place", "TitanTVMan8", "TitanTVMan", -17.5, 8.2, -11.1, 3 },
  201. { "upgrade", "TitanTVMan8", 6 },
  202. { "place", "TitanTVMan9", "TitanTVMan", -27.8, 8.2, -11.4, 3 },
  203. { "upgrade", "TitanTVMan9", 6 },
  204. { "place", "TitanTVMan10", "TitanTVMan", -26.9, 8.2, -21, 5 },
  205. { "upgrade", "TitanTVMan10", 6 },
  206. },
  207. ["ToiletHQ"] = {},
  208. }
  209.  
  210. function log(action, s)
  211. if SETTINGS.Debug then
  212. print("[" .. action .. "]:", s)
  213. end
  214. end
  215.  
  216. function getUnitPrice(unitType)
  217. return MultiboxFramework.SharedSettings.TroopDatas[unitType].Price
  218. end
  219.  
  220. function getUnitFromTroops(unitName)
  221. for _, c in ipairs(Workspace.Troops:GetChildren()) do
  222. if c:GetAttribute("Tag") and c:GetAttribute("Tag") == unitName then
  223. return c
  224. end
  225. end
  226.  
  227. return nil
  228. end
  229.  
  230. function spawnUnit(unitName, unitType, position, rotation)
  231. if rotation == nil then
  232. rotation = 1
  233. end
  234.  
  235. SpawningUnit = { unitName, unitType }
  236. log("Spawning unit", unitName)
  237. while getUnitFromTroops(unitName) == nil do
  238. if Money.Value > (getUnitPrice(unitType) * 1.25) then
  239. position += Vector3.new(math.random(-1,1), 0, math.random(-1,1))
  240. end
  241.  
  242. if Money.Value >= getUnitPrice(unitType) then
  243. ReplicatedStorage.RemoteEvent:FireServer(unpack({
  244. [1] = {
  245. [1] = {
  246. [1] = PACKETS.SPAWN_UNIT,
  247. [2] = unitType,
  248. [3] = position,
  249. [4] = rotation,
  250. },
  251. },
  252. }))
  253.  
  254. if SETTINGS.WalkToSpawnedUnit then
  255. Me.Character.Humanoid:MoveTo(position)
  256. end
  257. end
  258. wait(0.3)
  259. end
  260.  
  261. PlacedUnits[unitName] = getUnitFromTroops(unitName)
  262. SpawningUnit = nil
  263. log("Unit spawned", PlacedUnits[unitName].Name)
  264. return PlacedUnits[unitName]
  265. end
  266.  
  267. function upgradeUnit(unitName, toLevel)
  268. if not unitName or not PlacedUnits[unitName] then
  269. return
  270. end
  271.  
  272. local unit = getUnitFromTroops(unitName)
  273. while unit.TroopLevel.Value < toLevel do
  274. if Money.Value >= getUnitPrice(unit.Name) then
  275. log("Upgrading unit", string.format("%s (%s) LVL: %s / %s", unitName, unit.Name, unit.TroopLevel.Value, toLevel))
  276.  
  277. local packetsFolder = ReplicatedStorage.AutoSerde:GetChildren()
  278. ReplicatedStorage.RemoteEvent:FireServer(unpack({
  279. [1] = {
  280. [1] = {
  281. [1] = packetsFolder[#packetsFolder - 7].Value,
  282. [2] = getUnitFromTroops(unitName)
  283. },
  284. },
  285. }))
  286. end
  287. wait(3)
  288. end
  289.  
  290. log("Unit upgrading success", string.format("%s (%s) LVL: %s / %s", unitName, unit.Name, unit.TroopLevel.Value, toLevel))
  291. end
  292.  
  293. function sellUnit(unitName)
  294. if not unitName or not PlacedUnits[unitName] then
  295. return
  296. end
  297.  
  298. local unit = PlacedUnits[unitName]
  299.  
  300. log("Selling unit", string.format("%s (%s)", unitName, unit.Name))
  301.  
  302. ReplicatedStorage.RemoteEvent:FireServer(unpack({
  303. [1] = {
  304. [1] = {
  305. [1] = PACKETS.SELL_UNIT,
  306. [2] = unit,
  307. },
  308. },
  309. }))
  310. end
  311.  
  312. function skipWave()
  313. log("Skipping the wave", CurrentWave.Value)
  314. for i = 0, 2, 1 do
  315. ReplicatedStorage.RemoteEvent:FireServer(unpack({
  316. [1] = {
  317. [1] = {
  318. [1] = packetsFolder[#packetsFolder - i].Value,
  319. },
  320.  
  321. [2] = {
  322. [1] = packetsFolder[#packetsFolder - i].Value,
  323. },
  324.  
  325. [3] = {
  326. [1] = packetsFolder[#packetsFolder - i].Value,
  327. },
  328.  
  329. [4] = {
  330. [1] = packetsFolder[#packetsFolder - i].Value,
  331. },
  332. },
  333. }))
  334. task.wait(0.01)
  335. end
  336. end
  337.  
  338.  
  339. if SETTINGS.RemoveDecorations and Workspace:FindFirstChild("Decoration") then
  340. for k, v in pairs(Workspace.Decoration:GetChildren()) do
  341. v:Destroy()
  342. end
  343. end
  344.  
  345. if SETTINGS.RemoveAttackers and Workspace:FindFirstChild("Attackers") then
  346. for k, v in pairs(Workspace.Attackers:GetChildren()) do
  347. v:Destroy()
  348. end
  349. Workspace.Attackers.ChildAdded:Connect(function(child)
  350. task.wait(0.001)
  351. child:Destroy()
  352. end)
  353. end
  354.  
  355. if SETTINGS.FarmCoins then
  356. Workspace.Troops.ChildAdded:Connect(function(child)
  357. if not SpawningUnit then
  358. return
  359. end
  360.  
  361. local unitName, unitType = table.unpack(SpawningUnit)
  362. if child.Name ~= unitType then
  363. return
  364. end
  365.  
  366. child:SetAttribute("Tag", unitName)
  367. log("Detect UnitSpawned", child.Name)
  368. end)
  369.  
  370. Workspace.Troops.ChildRemoved:Connect(function(child)
  371. log("LastUnitRemoved", child.Name)
  372. LastUnitRemoved = child
  373. end)
  374.  
  375. -- skip first wave
  376. if SETTINGS.AutoSkip then
  377. skipWave()
  378. end
  379. CanSkip:GetPropertyChangedSignal("Value"):Connect(function()
  380. if SETTINGS.AutoSkip and CanSkip.Value then
  381. skipWave()
  382. end
  383. end)
  384.  
  385. CurrentWave:GetPropertyChangedSignal("Value"):Connect(function()
  386. local wave = CurrentWave.Value
  387.  
  388. if wave ~= 0 then
  389. log("New wave!", wave)
  390. else
  391. log("Preparing to new wave...")
  392. end
  393. end)
  394.  
  395. MatchTimer:GetPropertyChangedSignal("Value"):Connect(function()
  396. local time = MatchTimer.Value
  397. -- log("New wave!", time)
  398. end)
  399.  
  400.  
  401.  
  402. local BUILD = BUILDS[MapId.Value]
  403. for _, a in pairs(BUILD) do
  404. local action, name, arg1, arg2, arg3, arg4, arg5 = table.unpack(a)
  405.  
  406. if action == "place" then
  407. spawnUnit(name, arg1, Vector3.new(arg2, arg3, arg4), arg5)
  408. end
  409.  
  410. if action == "upgrade" then
  411. upgradeUnit(name, arg1)
  412. end
  413.  
  414. if action == "sell" then
  415. sellUnit(name)
  416. end
  417.  
  418. if action == "skip" then
  419. if CanSkip.Value then
  420. skipWave()
  421. end
  422. end
  423. task.wait(0.05)
  424. end
  425.  
  426. end
  427.  
  428. if SETTINGS.BuildDeckMode then
  429. local BuildFolder = nil
  430. local F = "PlacingModelsBuild"
  431.  
  432. if Workspace:FindFirstChild(F) then
  433. BuildFolder = Workspace.PlacingModelsBuild
  434. else
  435. BuildFolder = Instance.new("Folder", Workspace)
  436. BuildFolder.Parent = Workspace
  437. BuildFolder.Name = F
  438. end
  439.  
  440. local Mouse = Me:GetMouse()
  441.  
  442. function printUnit(model, s1, s2)
  443. local u = model:Clone()
  444. u.Parent = Workspace[F]
  445.  
  446. if u:FindFirstChild("Highlight") then
  447. u.Highlight.FillColor = Color3.fromRGB(60, 255, 255)
  448. u.HumanoidRootPart.TroopStatus.Enabled = true
  449. end
  450.  
  451. if u.HumanoidRootPart:FindFirstChild("TroopStatus") then
  452. if s1 then
  453. u.HumanoidRootPart.TroopStatus.TroopName.Text = s1
  454. end
  455. if s2 then
  456. u.HumanoidRootPart.TroopStatus.TroopLevel.Text = s2
  457. end
  458. end
  459. end
  460.  
  461. function saveUnitBuild()
  462. local PlacingUnits = Workspace.PlacingModels:GetChildren()
  463. for k, u in pairs(PlacingUnits) do
  464. if u.Highlight.FillColor.R ~= 1 then
  465. printUnit(
  466. u,
  467. string.format("%s", u.Name .. #Workspace[F]:GetChildren()),
  468. string.format("%.2f, %.2f, %.2f", u.WorldPivot.X, u.WorldPivot.X, u.WorldPivot.X)
  469. )
  470. end
  471. end
  472. end
  473.  
  474. Mouse.Button1Down:Connect(saveUnitBuild)
  475.  
  476. local UserInputService = game:GetService("UserInputService")
  477. UserInputService.InputBegan:Connect(function(input)
  478. local units = Workspace[F]:GetChildren()
  479. if input.KeyCode == Enum.KeyCode.Z then
  480. units[#units]:Destroy()
  481. end
  482. if input.KeyCode == Enum.KeyCode.B then
  483. saveUnitBuild()
  484. end
  485. if input.KeyCode == Enum.KeyCode.L then
  486. local b = ""
  487. for i, u in pairs(units) do
  488. b = b .. string.format("{ \"place\", \"%s\", \"%s\", %.2f, %.2f, %.2f, %01d },\n",
  489. u.Name .. i, u.Name, u.WorldPivot.X, u.WorldPivot.Y, u.WorldPivot.Z, 1)
  490. b = b .. string.format("{ \"upgrade\", \"%s\", %01d },\n", u.Name .. i, 5)
  491. end
  492. toclipboard(b)
  493. end
  494. if input.KeyCode == Enum.KeyCode.M then
  495. local BUILD = BUILDS[MapId.Value]
  496. for _, a in pairs(BUILD) do
  497. local action, name, arg1, arg2, arg3, arg4, arg5 = table.unpack(a)
  498.  
  499. if action == "place" then
  500. local model = MultiboxFramework.SharedSettings.TroopDatas[arg1].Model
  501. if arg1 == "TitanTVMan" then
  502. model = MultiboxFramework.SharedSettings.TroopDatas["TVMan"].Model
  503. end
  504. model.PriparyPart.CFrame = CFrame.new(arg2, arg3, arg4)
  505.  
  506. printUnit(
  507. model,
  508. string.format("%s", name),
  509. string.format("%.2f, %.2f, %.2f", arg2, arg3, arg4)
  510. )
  511. end
  512. end
  513. end
  514. end)
  515. end
  516. end
  517.  
  518.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement