Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- repeat
- wait(1)
- until game:IsLoaded()
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local Players = game:GetService("Players")
- local Me = Players.LocalPlayer
- local MultiboxFramework = require(ReplicatedStorage:WaitForChild("MultiboxFramework"))
- local IsLobby = ReplicatedStorage:FindFirstChild("IsLobby")
- local SETTINGS = {
- Debug = false, -- Print in console every action of bot
- FarmCoins = true, -- enables auto teleport in lobby to start game
- SoloFarm = true, -- start only solo games
- AutoPlayMap = "ToiletCity", -- ToiletCity Desert CameramanHQ
- AutoSkip = true, -- skip waves
- RemoveDecorations = true, -- visual remove decorations in game for placing units everywhere
- RemoveAttackers = true, -- visual remove enemies (just for fps boost)
- BuildDeckMode = false, -- enables build deck mode (line 477) works only if FarmCoins = false
- WalkToSpawnedUnit = false, -- makes player will move to place unit position
- }
- if SETTINGS.FarmCoins and IsLobby and IsLobby.Value then
- while true do
- for k, v in pairs(Workspace.Lifts:GetChildren()) do
- local counterCondition = v.Base.StatusGui.PlayersCount.Text == "0/5"
- if not SETTINGS.SoloFarm then
- counterCondition = v.Base.StatusGui.PlayersCount.Text ~= "0/5"
- end
- if v.Name == SETTINGS.AutoPlayMap and counterCondition then
- Me.Character.PrimaryPart.CFrame = v.Base.CFrame + Vector3.new(0, 0.5, 0)
- if SETTINGS.SoloFarm then
- Me.PlayerGui.Lobby.QueueFrame.Size = UDim2.new(1.1, 0, 1.1, 0)
- Me.PlayerGui.Lobby.QueueFrame.Position = UDim2.new(-0.1, 0, -0.1, 0)
- Me.PlayerGui.Lobby.QueueFrame.Start.Size = UDim2.new(1, 0, 1, 0)
- Me.PlayerGui.Lobby.QueueFrame.Start.Position = UDim2.new(0, 0, 0, 0)
- mousemoveabs(1, 1)
- wait(0.1)
- mousemoveabs(1, 1)
- wait(0.1)
- mousemoverel(1, 1)
- wait(0.1)
- mousemoverel(1, 1)
- wait(0.1)
- mouse1click()
- wait(0.1)
- mouse1click()
- wait(0.1)
- mouse1click()
- end
- wait(4)
- end
- end
- wait(0.1)
- end
- end
- if IsLobby and not IsLobby.Value then
- repeat
- wait(0.1)
- until MultiboxFramework and MultiboxFramework.SharedSettings
- local CanSkip = ReplicatedStorage.MatchData.CanSkip
- local CurrentWave = ReplicatedStorage.MatchData.CurrentWave
- local MatchTimer = ReplicatedStorage.MatchData.MatchTimer
- local MapId = ReplicatedStorage.MatchData.MapId
- local Money = Me.leaderstats.Money
- local PlacedUnits = {}
- local LastUnitSpawned = nil
- local LastUnitRemoved = nil
- local SpawningUnit = nil
- local packetsFolder = ReplicatedStorage.AutoSerde:GetChildren()
- local PACKETS = {
- SKIP_WAVE = packetsFolder[#packetsFolder - 2].Value,
- SPAWN_UNIT = packetsFolder[#packetsFolder - 14].Value,
- UPGRADE_UNIT = packetsFolder[#packetsFolder - 7].Value,
- SELL_UNIT = packetsFolder[#packetsFolder - 6].Value,
- }
- local BUILDS = {
- ["ToiletCity"] = {
- { "place", "NinjaCameraman1", "NinjaCameraman", -69.43, 2.5, -84.25, 1 },
- { "upgrade", "NinjaCameraman1", 3 },
- { "place", "TitanSpeakerman2", "TitanSpeakerman", -78, 8.48, -84.3, 1 },
- { "upgrade", "TitanSpeakerman2", 5 },
- { "place", "TitanSpeakerman3", "TitanSpeakerman", -77.8, 8.48, -97, 1 },
- { "upgrade", "TitanSpeakerman3", 5 },
- { "place", "TitanSpeakerman4", "TitanSpeakerman", -66.6, 8.48, -96.6, 1 },
- { "upgrade", "TitanSpeakerman4", 5 },
- { "place", "TitanSpeakerman5", "TitanSpeakerman", -53.27, 8.48, -46.17, 1 },
- { "upgrade", "TitanSpeakerman5", 5 },
- { "place", "TitanSpeakerman6", "TitanSpeakerman", -39.58, 8.48, -45.43, 1 },
- { "upgrade", "TitanSpeakerman6", 5 },
- { "place", "TitanSpeakerman7", "TitanSpeakerman", -23.92, 8.48, -45.09, 1 },
- { "upgrade", "TitanSpeakerman7", 5 },
- { "place", "TitanSpeakerman8", "TitanSpeakerman", -44.55, 8.48, -25.02, 1 },
- { "upgrade", "TitanSpeakerman8", 5 },
- { "place", "TitanSpeakerman9", "TitanSpeakerman", -63.44, 8.48, -28.68, 1 },
- { "upgrade", "TitanSpeakerman9", 5 },
- { "place", "TitanSpeakerman10", "TitanSpeakerman", -80.89, 8.48, -29.06, 1 },
- { "upgrade", "TitanSpeakerman10", 5 },
- { "place", "TitanSpeakerman11", "TitanSpeakerman", -43.43, 8.48, -10.81, 1 },
- { "upgrade", "TitanSpeakerman11", 5 },
- },
- ["Desert"] = {
- { "place", "TVMan1", "TVMan", -68.75, 2.68, -86.65, 1 },
- { "place", "ScientistCameraman2", "ScientistCameraman", -103.51, 2.50, -92.30, 1 },
- { "place", "NinjaCameraman3", "NinjaCameraman", -71.29, 2.50, -37.53, 1 },
- { "place", "ScientistCameraman4", "ScientistCameraman", -103.56, 2.50, -91.11, 1 },
- { "place", "ScientistCameraman5", "ScientistCameraman", -103.70, 2.50, -89.91, 1 },
- { "place", "ScientistCameraman6", "ScientistCameraman", -103.81, 2.50, -88.26, 1 },
- { "upgrade", "TVMan1", 3 },
- { "upgrade", "NinjaCameraman3", 4 },
- { "upgrade", "ScientistCameraman2", 2 },
- { "upgrade", "ScientistCameraman4", 2 },
- { "place", "TitanSpeakerman7", "TitanSpeakerman", -75.44, 8.48, -47.71, 1 },
- { "upgrade", "TitanSpeakerman7", 5 },
- { "upgrade", "ScientistCameraman5", 2 },
- { "upgrade", "ScientistCameraman6", 2 },
- { "place", "TitanSpeakerman8", "TitanSpeakerman", -32.89, 8.48, -46.21, 1 },
- { "upgrade", "TitanSpeakerman8", 5 },
- { "place", "TitanSpeakerman9", "TitanSpeakerman", -71.35, 8.48, -6.94, 1 },
- { "upgrade", "TitanSpeakerman9", 5 },
- { "place", "TitanTVMan10", "TitanTVMan", -91.41, 8.39, -73.60, 1 },
- { "upgrade", "TitanTVMan10", 6 },
- { "sell", "TVMan1" },
- { "sell", "NinjaCameraman3" },
- { "sell", "ScientistCameraman2" },
- { "sell", "ScientistCameraman4" },
- { "sell", "ScientistCameraman5" },
- { "sell", "ScientistCameraman6" },
- { "place", "TitanTVMan11", "TitanTVMan", -54.95, 8.39, -49.11, 1 },
- { "upgrade", "TitanTVMan11", 6 },
- { "place", "TitanTVMan12", "TitanTVMan", -59.42, 8.39, -7.41, 1 },
- { "upgrade", "TitanTVMan12", 6 },
- { "place", "TitanTVMan13", "TitanTVMan", -44.20, 8.39, -84.38, 1 },
- { "upgrade", "TitanTVMan13", 6 },
- { "place", "TitanTVMan14", "TitanTVMan", -36.48, 8.39, -67.53, 1 },
- { "upgrade", "TitanTVMan14", 6 },
- { "place", "TitanTVMan15", "TitanTVMan", -18.16, 8.39, -67.47, 1 },
- { "upgrade", "TitanTVMan15", 6 },
- { "place", "TitanTVMan16", "TitanTVMan", -15.34, 8.39, -45.78, 1 },
- { "upgrade", "TitanTVMan16", 6 },
- { "place", "TitanSpeakerman17", "TitanSpeakerman", -38.20, 8.48, -94.52, 1 },
- { "upgrade", "TitanSpeakerman17", 5 },
- { "place", "TitanSpeakerman18", "TitanSpeakerman", -37.43, 8.48, -85.74, 1 },
- { "upgrade", "TitanSpeakerman18", 5 },
- },
- ["CameramanHQ"] = {
- { "place", "ScientistCameraman1", "ScientistCameraman", 22, 2.3, -96, 1 },
- { "place", "ScientistCameraman2", "ScientistCameraman", 32, 2.3, -96, 1 },
- { "place", "TVMan1", "TVMan", 32.9, 2.5, -85, 1 },
- { "place", "NinjaCameraman1", "NinjaCameraman", -29, 2.3, -34, 1 },
- { "place", "ScientistCameraman3", "ScientistCameraman", 42, 2.3, -96, 1 },
- { "place", "ScientistCameraman4", "ScientistCameraman", 52, 2.3, -96, 1 },
- { "upgrade", "TVMan1", 2 },
- { "upgrade", "NinjaCameraman1", 2 },
- { "upgrade", "TVMan1", 3 },
- { "upgrade", "ScientistCameraman1", 2 },
- { "upgrade", "ScientistCameraman3", 2 },
- { "upgrade", "ScientistCameraman2", 2 },
- { "upgrade", "ScientistCameraman4", 2 },
- { "place", "TitanSpeakerman1", "TitanSpeakerman", -6, 8.2, -20, 1 },
- { "upgrade", "TitanSpeakerman1", 5 },
- { "place", "TitanSpeakerman2", "TitanSpeakerman", -16.3, 8.2, -20.3, 1 },
- { "upgrade", "TitanSpeakerman2", 5 },
- { "place", "TitanSpeakerman3", "TitanSpeakerman", -9.8, 8.2, -71, 3 },
- { "upgrade", "TitanSpeakerman3", 5 },
- { "place", "TitanTVMan1", "TitanTVMan", 25.7, 8.2, -67.2, 3 },
- { "upgrade", "TitanTVMan1", 6 },
- { "place", "TitanSpeakerman4", "TitanSpeakerman", -6.3, 8.2, -11.6, 5 },
- { "upgrade", "TitanSpeakerman4", 5 },
- { "sell", "ScientistCameraman1" },
- { "sell", "ScientistCameraman2" },
- { "sell", "ScientistCameraman3" },
- { "sell", "ScientistCameraman4" },
- { "sell", "TVMan1" },
- { "sell", "NinjaCameraman1" },
- { "place", "TitanSpeakerman5", "TitanSpeakerman", -9, 8.2, -62.7, 5 },
- { "upgrade", "TitanSpeakerman5", 5 },
- { "place", "TitanTVMan2", "TitanTVMan", -17.5, 8.2, -66.7, 7 },
- { "upgrade", "TitanTVMan2", 6 },
- { "place", "TitanTVMan3", "TitanTVMan", 17.0, 8.2, -67.1, 7 },
- { "upgrade", "TitanTVMan3", 6 },
- { "place", "TitanTVMan4", "TitanTVMan", 8.5, 8.2, -67.5, 7 },
- { "upgrade", "TitanTVMan4", 6 },
- { "place", "TitanTVMan5", "TitanTVMan", -1.4, 8.2, -34.1, 1 },
- { "upgrade", "TitanTVMan5", 6 },
- { "place", "TitanTVMan6", "TitanTVMan", -12.2, 8.2, -34.2, 1 },
- { "upgrade", "TitanTVMan6", 6 },
- { "place", "TitanTVMan7", "TitanTVMan", -21.1, 8.2, -33.7, 3 },
- { "upgrade", "TitanTVMan7", 6 },
- { "place", "TitanTVMan8", "TitanTVMan", -17.5, 8.2, -11.1, 3 },
- { "upgrade", "TitanTVMan8", 6 },
- { "place", "TitanTVMan9", "TitanTVMan", -27.8, 8.2, -11.4, 3 },
- { "upgrade", "TitanTVMan9", 6 },
- { "place", "TitanTVMan10", "TitanTVMan", -26.9, 8.2, -21, 5 },
- { "upgrade", "TitanTVMan10", 6 },
- },
- ["ToiletHQ"] = {},
- }
- function log(action, s)
- if SETTINGS.Debug then
- print("[" .. action .. "]:", s)
- end
- end
- function getUnitPrice(unitType)
- return MultiboxFramework.SharedSettings.TroopDatas[unitType].Price
- end
- function getUnitFromTroops(unitName)
- for _, c in ipairs(Workspace.Troops:GetChildren()) do
- if c:GetAttribute("Tag") and c:GetAttribute("Tag") == unitName then
- return c
- end
- end
- return nil
- end
- function spawnUnit(unitName, unitType, position, rotation)
- if rotation == nil then
- rotation = 1
- end
- SpawningUnit = { unitName, unitType }
- log("Spawning unit", unitName)
- while getUnitFromTroops(unitName) == nil do
- if Money.Value > (getUnitPrice(unitType) * 1.25) then
- position += Vector3.new(math.random(-1,1), 0, math.random(-1,1))
- end
- if Money.Value >= getUnitPrice(unitType) then
- ReplicatedStorage.RemoteEvent:FireServer(unpack({
- [1] = {
- [1] = {
- [1] = PACKETS.SPAWN_UNIT,
- [2] = unitType,
- [3] = position,
- [4] = rotation,
- },
- },
- }))
- if SETTINGS.WalkToSpawnedUnit then
- Me.Character.Humanoid:MoveTo(position)
- end
- end
- wait(0.3)
- end
- PlacedUnits[unitName] = getUnitFromTroops(unitName)
- SpawningUnit = nil
- log("Unit spawned", PlacedUnits[unitName].Name)
- return PlacedUnits[unitName]
- end
- function upgradeUnit(unitName, toLevel)
- if not unitName or not PlacedUnits[unitName] then
- return
- end
- local unit = getUnitFromTroops(unitName)
- while unit.TroopLevel.Value < toLevel do
- if Money.Value >= getUnitPrice(unit.Name) then
- log("Upgrading unit", string.format("%s (%s) LVL: %s / %s", unitName, unit.Name, unit.TroopLevel.Value, toLevel))
- local packetsFolder = ReplicatedStorage.AutoSerde:GetChildren()
- ReplicatedStorage.RemoteEvent:FireServer(unpack({
- [1] = {
- [1] = {
- [1] = packetsFolder[#packetsFolder - 7].Value,
- [2] = getUnitFromTroops(unitName)
- },
- },
- }))
- end
- wait(3)
- end
- log("Unit upgrading success", string.format("%s (%s) LVL: %s / %s", unitName, unit.Name, unit.TroopLevel.Value, toLevel))
- end
- function sellUnit(unitName)
- if not unitName or not PlacedUnits[unitName] then
- return
- end
- local unit = PlacedUnits[unitName]
- log("Selling unit", string.format("%s (%s)", unitName, unit.Name))
- ReplicatedStorage.RemoteEvent:FireServer(unpack({
- [1] = {
- [1] = {
- [1] = PACKETS.SELL_UNIT,
- [2] = unit,
- },
- },
- }))
- end
- function skipWave()
- log("Skipping the wave", CurrentWave.Value)
- for i = 0, 2, 1 do
- ReplicatedStorage.RemoteEvent:FireServer(unpack({
- [1] = {
- [1] = {
- [1] = packetsFolder[#packetsFolder - i].Value,
- },
- [2] = {
- [1] = packetsFolder[#packetsFolder - i].Value,
- },
- [3] = {
- [1] = packetsFolder[#packetsFolder - i].Value,
- },
- [4] = {
- [1] = packetsFolder[#packetsFolder - i].Value,
- },
- },
- }))
- task.wait(0.01)
- end
- end
- if SETTINGS.RemoveDecorations and Workspace:FindFirstChild("Decoration") then
- for k, v in pairs(Workspace.Decoration:GetChildren()) do
- v:Destroy()
- end
- end
- if SETTINGS.RemoveAttackers and Workspace:FindFirstChild("Attackers") then
- for k, v in pairs(Workspace.Attackers:GetChildren()) do
- v:Destroy()
- end
- Workspace.Attackers.ChildAdded:Connect(function(child)
- task.wait(0.001)
- child:Destroy()
- end)
- end
- if SETTINGS.FarmCoins then
- Workspace.Troops.ChildAdded:Connect(function(child)
- if not SpawningUnit then
- return
- end
- local unitName, unitType = table.unpack(SpawningUnit)
- if child.Name ~= unitType then
- return
- end
- child:SetAttribute("Tag", unitName)
- log("Detect UnitSpawned", child.Name)
- end)
- Workspace.Troops.ChildRemoved:Connect(function(child)
- log("LastUnitRemoved", child.Name)
- LastUnitRemoved = child
- end)
- -- skip first wave
- if SETTINGS.AutoSkip then
- skipWave()
- end
- CanSkip:GetPropertyChangedSignal("Value"):Connect(function()
- if SETTINGS.AutoSkip and CanSkip.Value then
- skipWave()
- end
- end)
- CurrentWave:GetPropertyChangedSignal("Value"):Connect(function()
- local wave = CurrentWave.Value
- if wave ~= 0 then
- log("New wave!", wave)
- else
- log("Preparing to new wave...")
- end
- end)
- MatchTimer:GetPropertyChangedSignal("Value"):Connect(function()
- local time = MatchTimer.Value
- -- log("New wave!", time)
- end)
- local BUILD = BUILDS[MapId.Value]
- for _, a in pairs(BUILD) do
- local action, name, arg1, arg2, arg3, arg4, arg5 = table.unpack(a)
- if action == "place" then
- spawnUnit(name, arg1, Vector3.new(arg2, arg3, arg4), arg5)
- end
- if action == "upgrade" then
- upgradeUnit(name, arg1)
- end
- if action == "sell" then
- sellUnit(name)
- end
- if action == "skip" then
- if CanSkip.Value then
- skipWave()
- end
- end
- task.wait(0.05)
- end
- end
- if SETTINGS.BuildDeckMode then
- local BuildFolder = nil
- local F = "PlacingModelsBuild"
- if Workspace:FindFirstChild(F) then
- BuildFolder = Workspace.PlacingModelsBuild
- else
- BuildFolder = Instance.new("Folder", Workspace)
- BuildFolder.Parent = Workspace
- BuildFolder.Name = F
- end
- local Mouse = Me:GetMouse()
- function printUnit(model, s1, s2)
- local u = model:Clone()
- u.Parent = Workspace[F]
- if u:FindFirstChild("Highlight") then
- u.Highlight.FillColor = Color3.fromRGB(60, 255, 255)
- u.HumanoidRootPart.TroopStatus.Enabled = true
- end
- if u.HumanoidRootPart:FindFirstChild("TroopStatus") then
- if s1 then
- u.HumanoidRootPart.TroopStatus.TroopName.Text = s1
- end
- if s2 then
- u.HumanoidRootPart.TroopStatus.TroopLevel.Text = s2
- end
- end
- end
- function saveUnitBuild()
- local PlacingUnits = Workspace.PlacingModels:GetChildren()
- for k, u in pairs(PlacingUnits) do
- if u.Highlight.FillColor.R ~= 1 then
- printUnit(
- u,
- string.format("%s", u.Name .. #Workspace[F]:GetChildren()),
- string.format("%.2f, %.2f, %.2f", u.WorldPivot.X, u.WorldPivot.X, u.WorldPivot.X)
- )
- end
- end
- end
- Mouse.Button1Down:Connect(saveUnitBuild)
- local UserInputService = game:GetService("UserInputService")
- UserInputService.InputBegan:Connect(function(input)
- local units = Workspace[F]:GetChildren()
- if input.KeyCode == Enum.KeyCode.Z then
- units[#units]:Destroy()
- end
- if input.KeyCode == Enum.KeyCode.B then
- saveUnitBuild()
- end
- if input.KeyCode == Enum.KeyCode.L then
- local b = ""
- for i, u in pairs(units) do
- b = b .. string.format("{ \"place\", \"%s\", \"%s\", %.2f, %.2f, %.2f, %01d },\n",
- u.Name .. i, u.Name, u.WorldPivot.X, u.WorldPivot.Y, u.WorldPivot.Z, 1)
- b = b .. string.format("{ \"upgrade\", \"%s\", %01d },\n", u.Name .. i, 5)
- end
- toclipboard(b)
- end
- if input.KeyCode == Enum.KeyCode.M then
- local BUILD = BUILDS[MapId.Value]
- for _, a in pairs(BUILD) do
- local action, name, arg1, arg2, arg3, arg4, arg5 = table.unpack(a)
- if action == "place" then
- local model = MultiboxFramework.SharedSettings.TroopDatas[arg1].Model
- if arg1 == "TitanTVMan" then
- model = MultiboxFramework.SharedSettings.TroopDatas["TVMan"].Model
- end
- model.PriparyPart.CFrame = CFrame.new(arg2, arg3, arg4)
- printUnit(
- model,
- string.format("%s", name),
- string.format("%.2f, %.2f, %.2f", arg2, arg3, arg4)
- )
- end
- end
- end
- end)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement