Advertisement
King_96

SB2-Undermap

Feb 8th, 2020
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.17 KB | None | 0 0
  1. noclip = true -- thanks to @0_Viper#8530
  2. game:GetService('RunService').Stepped:connect(function()
  3. if noclip then
  4.   game.Players.LocalPlayer.Character.Humanoid:ChangeState(11)
  5. end
  6. end)
  7.  
  8. _G.farm= true
  9.  
  10. local Rawr = {}
  11. local Api = {}
  12. local Log = {}
  13.  
  14. local function Service(name)
  15.   return game:GetService(name)
  16. end
  17.  
  18. local function SecondsToClock(seconds)
  19.   -- https://gist.github.com/jesseadams/791673
  20.   local seconds = tonumber(seconds)
  21.   if seconds <= 0 then
  22.     return "00:00:00";
  23.   else
  24.     local hours = string.format("%02.f", math.floor(seconds/3600));
  25.     local mins = string.format("%02.f", math.floor(seconds/60 - (hours*60)));
  26.     local secs = string.format("%02.f", math.floor(seconds - hours*3600 - mins *60));
  27.     return hours..":"..mins..":"..secs
  28.   end
  29. end
  30.  
  31. function Log:Init()
  32.   local Profile = game:GetService("ReplicatedStorage").Profiles[Api.GetPlayer().Name]
  33.   local Vel = Profile.Stats.Vel
  34.   local LastVel = Vel.Value
  35.   Log.Earned = {
  36.     Vel = 0,
  37.     Items = {},
  38.   }
  39.   Profile.Inventory.ChildAdded:Connect(function(item)
  40.   table.insert(Log.Earned.Items, item.Name)
  41.   if(Api.GetSetting("auto_dismantle") == true)then
  42.     Api.Dismantle(item.Name)
  43.   end
  44.   end)
  45.   Vel.Changed:Connect(function()
  46.   local earn = Vel.Value - LastVel
  47.   LastVel = Vel.Value
  48.   Log.Earned.Vel = Log.Earned.Vel + earn
  49.   end)
  50. end
  51.  
  52. function Log.Save()
  53.   Log.Earned.RunTime = SecondsToClock(tick()-Api.Start)
  54.   Synapse:WriteFile(tick() .. "_log.dat", game:GetService("HttpService"):JSONEncode(Log.Earned))
  55. end
  56.  
  57. function Rawr:Check(...) --secret sauce
  58.   local player = Api.GetPlayer()
  59.   local character = Api.GetCharacter()
  60.   local args = {...}
  61.  
  62.   if(character and character.PrimaryPart and args[1]:lower()=="cframe")then
  63.     --player.Character = Api.FakeCharacter
  64.     player.Character.RobloxLocked = true
  65.     wait(Api.GetSetting("rawr_bypass_speed"))
  66.     character:SetPrimaryPartCFrame(args[2])
  67.     wait(Api.GetSetting("rawr_bypass_speed"))
  68.     --player.Character = character
  69.     player.Character.RobloxLocked = false
  70.   end
  71. end
  72.  
  73. function Api.GetPlayer()
  74.   return game:GetService("Players").LocalPlayer
  75. end
  76.  
  77. function Api.Dismantle(name)
  78.   game.ReplicatedStorage.Event:FireServer("Equipment", {
  79.     "Dismantle",
  80.     game:GetService("ReplicatedStorage").Profiles[Api.GetPlayer().Name].Inventory[name]
  81.   })
  82.   end
  83.  
  84.   function Api.Replicate(object)
  85.     local Model = Instance.new("Model")
  86.     Model.Name = object.Name
  87.     for index, child in pairs(object:GetChildren()) do
  88.       local c = child:Clone()
  89.       c.Parent = Model
  90.     end
  91.     if(object.PrimaryPart)then
  92.       Model.PrimaryPart = Model[object.PrimaryPart.Name]
  93.     end
  94.     return Model
  95.   end
  96.  
  97.   function Api.GetCharacter()
  98.     return Api.Character or Api.GetPlayer().Character
  99.   end
  100.  
  101.   function Api.GetEntity(model)
  102.     return model:FindFirstChild("Entity")
  103.   end
  104.  
  105.   function Api.Settings(...)
  106.     Api.Settings = {}
  107.     for name, value in pairs(...) do
  108.       Api.Settings[name] = value
  109.     end
  110.   end
  111.  
  112.   function Api.GetSetting(name)
  113.     return Api.Settings[name]
  114.   end
  115.  
  116.   function Api.IsValid(model)
  117.     if(model.PrimaryPart and model:FindFirstChild("Entity") and model.Entity:FindFirstChild("Health") and model.Parent~=nil and model:FindFirstChild("Nameplate"))then
  118.       return true
  119.     end
  120.   end
  121.  
  122.   function Api.GetPlayerDistances(model)
  123.     local localPlayer = Api.GetPlayer()
  124.     local distances = {}
  125.     for index, player in pairs(Service("Players"):GetChildren()) do
  126.       if(player~=localPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") and model:FindFirstChild("HumanoidRootPart"))then
  127.         distances[player.Name] = (model.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).magnitude
  128.       end
  129.     end
  130.     return distances
  131.   end
  132.  
  133.   function Api.CheckNear(monster)
  134.     if(Api.GetSetting("avoid_players_nearby")["Enabled"] == true)then
  135.       local max_distance = Api.GetSetting("avoid_players_nearby")["Distance"]
  136.       local distances = Api.GetPlayerDistances(monster)
  137.       for player, distance in pairs(distances)do
  138.         if(distance <= max_distance)then
  139.           return false
  140.         end
  141.       end
  142.     end
  143.     return true
  144.   end
  145.  
  146.   function Api.CheckBlacklist(monster)
  147.     for index, blacklist in pairs(Api.Blacklist) do
  148.       if(monster == blacklist)then
  149.         return false
  150.       end
  151.     end
  152.     return true
  153.   end
  154.  
  155.   function Api.GetMonsters()
  156.     local targets = {}
  157.     for index, monster in pairs(Service("Workspace").Mobs:GetChildren()) do
  158.       local entity = monster:FindFirstChildOfClass("Folder")
  159.       local filterApplied = false
  160.       --local distanceCheck = Api.CheckNear(monster)
  161.       if(monster.PrimaryPart and Api.IsValid(monster) and Api.CheckBlacklist(monster))then
  162.         if(Api.GetSetting("monster_filter")["Enabled"] == true)then
  163.           if(entity.Health.Value >= Api.GetSetting("monster_filter")["max_monster_health"] and entity.Exp.Value >= Api.GetSetting("monster_filter")["min_exp_earned"])then
  164.             table.insert(targets, monster)
  165.           end
  166.           filterApplied = true
  167.         elseif(Api.GetSetting("target_specific_enemy").Enabled == true)then
  168.           if(Api.GetSetting("target_specific_enemy").Names[monster.Nameplate.SurfaceGui.TextLabel.Text] == true)then
  169.             table.insert(targets, monster)
  170.           end
  171.           filterApplied = true
  172.         end
  173.         if(filterApplied == false)then
  174.           table.insert(targets, monster)
  175.         end
  176.       end
  177.     end
  178.     return targets
  179.   end
  180.  
  181.   function Api:Connect()
  182.     local player = Api.GetPlayer()
  183.     local character = Api.GetCharacter()
  184.     local setupCharacter = function(character)
  185.     Api.FakeCharacter = Api.Replicate(character)
  186.   end
  187.  
  188.   setupCharacter(character)
  189.   player.CharacterAdded:Connect(setupCharacter)
  190. end
  191.  
  192. function Api.BigHitbox()
  193. --EXPERIMENTAL
  194. for i,v in pairs(game.Workspace.Mobs:children()) do
  195.   if v:FindFirstChild("Head") then
  196.     v.HumanoidRootPart.Transparency = 0.5
  197.     v.HumanoidRootPart.Size = Vector3.new(Api.GetSetting("hbx"), Api.GetSetting("hby"), Api.GetSetting("hbz"))
  198.   end
  199.   if v:FindFirstChild("Torso") then
  200.     v.HumanoidRootPart.Transparency = 0.5
  201.     v.HumanoidRootPart.Size = Vector3.new(Api.GetSetting("hbx"), Api.GetSetting("hby"), Api.GetSetting("hbz"))
  202.   end
  203. end
  204. end
  205.  
  206. function Api:SetKeys()
  207.   game:GetService("UserInputService").InputBegan:connect(function(Key)
  208.   if(Key.KeyCode == Api.GetSetting("stop_key"))then
  209.     Api.Enabled = false
  210.   elseif(Key.KeyCode == Api.GetSetting("pause_key"))then
  211.     Api.Paused = true
  212.   elseif(Key.KeyCode == Api.GetSetting("unpause_key"))then
  213.     Api.Paused = false
  214.   end
  215.   end)
  216. end
  217. --[[
  218. CREATED BY Methode @v3rmillion
  219. MODIFIED BY ZombieRushFan @v3rmillion || Styler12#2196 || Sealtiel Dy @FB
  220. ]]
  221. function Api:Init()
  222.   Api.Blacklist = {}
  223.   Api.Start = tick()
  224.   Api.Paused = false
  225.   Api.CanClick = false
  226.   Api.Enabled = true
  227.   wait(Api.GetSetting("StartDelay"))
  228.   spawn(function()
  229.   while wait(Api.GetSetting("click_break_speed")) and Api.Enabled do
  230.     if(Api.Paused == false and Api.CanClick == true)then
  231.       if(mouse1click)then
  232.         mouse1click()
  233.       end
  234.     else
  235.       wait()
  236.     end
  237.   end
  238.   end)
  239.   while wait() and Api.Enabled and _G.farm == true do
  240.     if(Api.Paused == false)then
  241.       --game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(116, 960, 23865)) --F10 Boss
  242.       --game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(12400, 540, -3380)) --F9 Boss
  243.       for index, monster in pairs(Api.GetMonsters()) do
  244.         --local distanceCheck = Api.CheckNear(monster)
  245.         if(Api.IsValid(monster) and Api.Enabled and _G.farm==true)then -- recheck
  246.           Rawr:Check("CFrame", monster:GetPrimaryPartCFrame() * CFrame.Angles(math.rad(Api.GetSetting("rocX")),math.rad(Api.GetSetting("rocY")),math.rad(Api.GetSetting("rocZ"))) * CFrame.new(Api.GetSetting("dfmX"), Api.GetSetting("dfmY"),  Api.GetSetting("dfmZ"))) -- bypass
  247.           wait(Api.GetSetting("swap_monster_speed"))
  248.           local entity = Api.GetEntity(monster)
  249.           local base = entity.Health.Value
  250.           entity.Health.Changed:Connect(function()
  251.           if(entity.Health.Value == base)then
  252.             dontBreak = false
  253.           end
  254.           end)
  255.           Api.BigHitbox()
  256.           dontBreak = true
  257.           local timer = 0
  258.           while dontBreak and Api.Enabled do
  259.             if(Api.Paused == false)then
  260.               local thisTime = wait()
  261.               wait(thisTime)
  262.               timer = timer + thisTime
  263.               if(timer >= Api.GetSetting("timeout")["time"])then
  264.                 warn('Timeout exceeded!')
  265.                 if(Api.GetSetting("timeout")["blacklist_monster_after_timeout"] == true)then
  266.                   table.insert(Api.Blacklist, monster)
  267.                 end
  268.                 break
  269.               end
  270.               if(Api.IsValid(monster) and entity.Health.Value > 0 and _G.farm == true)then
  271.                 local character = Api.GetCharacter()
  272.                 if(character)then
  273.                   Api.CanClick = false -- true
  274.                   character:SetPrimaryPartCFrame(monster:GetPrimaryPartCFrame() * CFrame.Angles(math.rad(Api.GetSetting("rocX")),math.rad(Api.GetSetting("rocY")),math.rad(Api.GetSetting("rocZ"))) * CFrame.new(Api.GetSetting("dfmX"), Api.GetSetting("dfmY"), Api.GetSetting("dfmZ")))
  275.                   wait(Api.GetSetting("swap_monster_speed"))
  276.                 else
  277.                   character = Api.GetCharacter()
  278.                   if(character)then
  279.                     Rawr:Check("CFrame", monster:GetPrimaryPartCFrame() * CFrame.Angles(math.rad(Api.GetSetting("rocX")),math.rad(Api.GetSetting("rocY")),math.rad(Api.GetSetting("rocZ"))) * CFrame.new(Api.GetSetting("dfmX"),  Api.GetSetting("dfmY"), Api.GetSetting("dfmZ"))) -- bypass
  280.                     wait(Api.GetSetting("swap_monster_speed"))
  281.                     wait(Api.GetSetting("swap_monster_speed"))
  282.                   end
  283.                 end
  284.               else
  285.                 Api.CanClick = false
  286.                 break
  287.               end
  288.             else
  289.               wait()
  290.             end
  291.           end
  292.           wait(Api.GetSetting("swap_monster_speed"))
  293.         end
  294.       end
  295.     end
  296.   end
  297.   --Log.Save()
  298.   --local targets = {}
  299. end
  300.  
  301. Api.Settings({
  302.   ["start_delay"] = 1,
  303.   ["stop_key"] = Enum.KeyCode.Escape,
  304.   ["pause_key"] = Enum.KeyCode.LeftControl,
  305.   ["unpause_key"] = Enum.KeyCode.RightControl,
  306.   ["rawr_bypass_speed"] = 0.1, -- 0.1
  307.   ["swap_monster_speed"] = 0.05, -- 0.05,
  308.   ["click_break_speed"] = 0.01,
  309.   ["auto_dismantle"] = false,
  310.   ["hbx"] = 12, -- size of hitbox X-Axis
  311.   ["hby"] = 40, -- size of hitbox Y-Axis
  312.   ["hbz"] = 12, -- size of hitbox Z-Axis
  313.   ["rocX"] = 0, -- rotation of character based on X-Axis
  314.   ["rocY"] = 0,  -- rotation of character based on Y-Axis
  315.   ["rocZ"] = 0,  -- rotation of character based on Z-Axis
  316.   ["dfmX"] = 0,  -- distance from the mob in X-Axis based on rotation
  317.   ["dfmY"] = -13,  -- distance from the mob in Y-Axis based on rotation
  318.   ["dfmZ"] = 10, -- distance from the mob in Z-Axis based on rotation
  319.   ["timeout"] = {
  320.     ["time"] = 45,
  321.     ["blacklist_monster_after_timeout"] = false
  322.   },
  323.   ["monster_filter"] = {
  324.     ["Enabled"] = false,
  325.     ["max_monster_health"] = 0,
  326.     ["min_exp_earned"] = 1,
  327.   },
  328.   ["avoid_players_nearby"] = {
  329.     ["Enabled"] = true,
  330.     ["Distance"] = 200
  331.   },
  332.   ["target_specific_enemy"] = {
  333.     ["Enabled"] = false,
  334.     ["Names"] = {
  335.       ["Grim the Overseer"] = true,
  336.       ["Baal"] = true,
  337.       ["Shady Villager"] = false,
  338.       ["Winged Minion"] = false,
  339.       ["Wendigo"] = false,
  340.       ["Undead Warrior"] = false,
  341.       ["Gargoyle Reaper"] = true,
  342.       ["Mortis the Flaming Sear"] = true,
  343.       ["Polyserpant"] = true,
  344.       ["Ent"] = true,
  345.       ["Patrolman Elite"] = false,
  346.       ["Centaurian Defender"] = false,
  347.       ["Sa'jun the Centurian Chieftain"] = false,
  348.       ["Fire Scorpion"] = false,
  349.       ["Formaug the Jungle Giant"] = true,
  350.       ["Hippogriff"] = false,
  351.       ["Wingless Hippogriff"] = false,
  352.       ["Petal Knight"] = false,
  353.       ["Dungeon Crusador"] = false,
  354.     }
  355.   }
  356. })
  357.  
  358. Api:SetKeys()
  359. Api:Connect()
  360. Log:Init()
  361. Api:Init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement