IY_plugin_store

FragBot

Nov 27th, 2021 (edited)
1,018
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local camera = workspace.CurrentCamera;
  2. local players = game:GetService("Players");
  3. local localPlayer = players.LocalPlayer;
  4. local charTbl;
  5. local replicationTbl;
  6. local pfCam;
  7. local gameLogic;
  8. local network;
  9. local hud;
  10. local char;
  11. local menu;
  12. local queueonteleport = (syn and syn.queue_on_teleport) or queue_on_teleport or function() end
  13. local ts,x = game:GetService("TeleportService")
  14. respawns_before_serverhop = respawns_before_serverhop or 0
  15. local tp = respawns_before_serverhop
  16. if tp == 0 then tp = math.huge end
  17. queueonteleport("if not game:IsLoaded() then wait(3) end respawns_before_serverhop = "..tostring(respawns_before_serverhop).."\nloadstring(game:HttpGet('https://pastebin.com/raw/PyWPzvyL'))()")
  18.  
  19. local function ondisconnect()
  20.     ts:TeleportCancel()
  21.     if not x then
  22.         x = {}
  23.         for _,v in pairs(game:GetService("HttpService"):JSONDecode(game:HttpGetAsync("https://games.roblox.com/v1/games/"..game.PlaceId.."/servers/Public?sortOrder=Asc&limit=100")).data) do
  24.                 if type(v) == "table" and v.maxPlayers > v.playing and v.id ~= game.JobId then
  25.                        x[#x + 1] = v.id
  26.             end
  27.     end
  28.   end
  29.     if #x > 0 then
  30.         game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId, x[math.random(1, #x)])
  31.     end
  32. end
  33. ts.TeleportInitFailed:Connect(ondisconnect)
  34. game:GetService("Stats").Network.ChildRemoved:Connect(function(disconnected) if disconnected.Name=="ServerStatsItem" then ondisconnect() end end)
  35. task.spawn(function() for i = 1,10 do if not game:GetService("Stats").Network:FindFirstChild("ServerStatsItem") then ondisconnect() return end wait(1) end end)
  36. local things = 0
  37. repeat
  38. things = 0
  39. for i,v in pairs(getgc(true)) do
  40.    if type(v) == "table" then
  41.        if rawget(v, "getbodyparts") then
  42.            replicationTbl = v;
  43.            charTbl = debug.getupvalue(v.getbodyparts, 1);
  44.            things +=2
  45.        end
  46.        if rawget(v, "basecframe") then
  47.            pfCam = v;
  48.            things +=1
  49.        end
  50.        if rawget(v, "gammo") then
  51.            gameLogic = v;
  52.            things +=1
  53.        end
  54.        if rawget(v, "send") then
  55.            network = v;
  56.            things +=1
  57.        end
  58.        if rawget(v, "updateammo") then
  59.            hud = v;
  60.            things +=1
  61.        end
  62.        if rawget(v, "jump") then
  63.            char = v;
  64.            things +=1
  65.        end
  66.        if rawget(v, "isdeployed") then
  67.            menu = v;
  68.            things +=1
  69.        end
  70.    end
  71. end
  72. wait(1)
  73. until things == 8
  74. local function shootNade(targetPos)
  75.    if gameLogic.gammo <= 0 then
  76.        return;
  77.    end
  78.    local camCf = camera.CFrame;
  79.    local rot = (camCf - camCf.Position);
  80.    local args = {
  81.        time = tick(),
  82.        blowuptime = 0,
  83.        frames = {
  84.            {
  85.                t0 = 0,
  86.                p0 = camCf.Position,
  87.                v0 = camCf.LookVector,
  88.                offset = Vector3.new(),
  89.                a = Vector3.new(0, -80,0),
  90.                rot0 = rot,
  91.                rotv = rot * Vector3.new(19, -5, 0),
  92.                glassbreaks = {}
  93.            },
  94.            {
  95.                t0 = 0,
  96.                p0 = targetPos,
  97.                v0 = Vector3.new(),
  98.                offset = Vector3.new(),
  99.                a = Vector3.new(),
  100.                rot0 = CFrame.new(),
  101.                rotv = Vector3.new(),
  102.                glassbreaks = {}
  103.            }
  104.        }
  105.    };
  106.    network:send("newgrenade", "FRAG", args);
  107.    gameLogic.gammo = gameLogic.gammo - 1;
  108.    hud:updateammo("GRENADE");
  109. end
  110.  
  111. local function getCharacterInCircle(center, radius)
  112.    local results = {};
  113.    for player, character in pairs(charTbl) do
  114.        if player.Team ~= localPlayer.Team then
  115.            if character.torso and (character.torso.Position - center).Magnitude <= radius then
  116.                results[#results + 1] = character;
  117.            end
  118.        end
  119.    end
  120.    return results;
  121. end
  122.  
  123.  
  124. while tp>0 do
  125.   tp-=1
  126.   do
  127.      if not (char.rootpart and menu:isdeployed()) then
  128.          repeat
  129.              menu:deploy();
  130.              task.wait();
  131.          until char.rootpart and menu:isdeployed();
  132.      end
  133.      task.wait(1);
  134.      local targets = {};
  135.      for player, character in pairs(charTbl) do
  136.          if player.Team ~= localPlayer.Team then
  137.              if character.torso and character.head then
  138.                  local charsInCircle = getCharacterInCircle(character.torso.Position, 30);
  139.                  targets[#targets + 1] = charsInCircle;
  140.              end
  141.          end
  142.      end
  143.      table.sort(targets, function(a, b)
  144.          return #a > #b;
  145.      end);
  146.      for i = 1, 3 do
  147.          local t = targets[i];
  148.          if t then
  149.              for j = 1, #t do
  150.                  local theirChar = t[j];
  151.                  if theirChar and theirChar.torso then
  152.                      shootNade(theirChar.torso.Position);
  153.                      task.wait(0.1);
  154.                  end
  155.              end
  156.          end
  157.      end
  158.   end
  159.   network:send("forcereset");
  160.   repeat task.wait() until not menu:isdeployed()
  161. end
  162. ondisconnect()
RAW Paste Data