whiteyume

Untitled

Jun 4th, 2021
868
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.32 KB | None | 0 0
  1. --[[
  2. Loop Kill For Phantom Forces
  3. Created By: The3Bakers#4565
  4. ]]
  5.  
  6.  
  7. --main Spawn Explosion Function
  8. local function Summoncum(x)
  9. local pos=x or Vector3.new()
  10. game:GetService("ControllerService").RemoteEvent:FireServer("newgrenade","FRAG",{["frames"]={{["v0"]=Vector3.new(),["glassbreaks"]={},["t0"]=0,["offset"]=Vector3.new(),["rot0"]=CFrame.new(0,0,0,-math.random(),-math.random(),-math.random(),-math.random(),-math.random(),math.random(),-math.random(),math.random(),math.random()),["a"]=Vector3.new(0,-80,0),["p0"]=game.Players.LocalPlayer.Character.HumanoidRootPart.Position,["rotv"]=Vector3.new(math.random(),math.random(),math.random())},{["v0"]=Vector3.new(),["glassbreaks"]={},["t0"]=.5,["a"]=Vector3.new(),["offset"]=Vector3.new(0,0,math.random()),["rot0"]=CFrame.new(0,0,0,-math.random(),-math.random(),-math.random(),-math.random(),-math.random(),math.random(),-math.random(),math.random(),math.random()),["p0"]=pos,["rotv"]=Vector3.new(math.random(),math.random(),math.random())},{["v0"]=Vector3.new(math.random(),math.random(),math.random()),["glassbreaks"]={},["t0"]=0.7215486845+math.random()/100,["a"]=Vector3.new(),["offset"]=Vector3.new(0,math.random(),0),["rot0"]=CFrame.new(0,0,0,-math.random(),-math.random(),-math.random(),-math.random(),-math.random(),math.random(),-math.random(),math.random(),math.random()),["p0"]=Vector3.new(math.random(),math.random(),math.random())+pos,["rotv"]=Vector3.new()},{["v0"]=Vector3.new(math.random(),math.random(),math.random()),["glassbreaks"]={},["t0"]=0.77335467346+math.random()/100,["a"]=Vector3.new(),["offset"]=Vector3.new(0,math.random(),0),["rot0"]=CFrame.new(0,0,0,-math.random(),-math.random(),-math.random(),-math.random(),-math.random(),math.random(),-math.random(),math.random(),math.random()),["p0"]=Vector3.new(math.random(),math.random(),math.random())+pos,["rotv"]=Vector3.new()},{["v0"]=Vector3.new(math.random(),math.random(),math.random()),["glassbreaks"]={},["t0"]=0.8215347+math.random()/100,["a"]=Vector3.new(),["offset"]=Vector3.new(0,math.random(),0),["rot0"]=CFrame.new(0,0,0,-math.random(),-math.random(),-math.random(),-math.random(),-math.random(),math.random(),-math.random(),math.random(),math.random()),["p0"]=Vector3.new(math.random(),math.random(),math.random())+pos,["rotv"]=Vector3.new()},{["v0"]=Vector3.new(math.random(),math.random(),math.random()),["glassbreaks"]={},["t0"]=0.87652410493829+math.random()/100,["a"]=Vector3.new(),["offset"]=Vector3.new(0,math.random(),0),["rot0"]=CFrame.new(0,0,0,-math.random(),-math.random(),-math.random(),-math.random(),-math.random(),math.random(),-math.random(),math.random(),math.random()),["p0"]=Vector3.new(math.random(),math.random(),math.random())+pos,["rotv"]=Vector3.new()}},["time"]=tick(),["curi"]=1,["blowuptime"]=0})
  11. end
  12. --while wait()do because renderstepped:connect was being a faggot
  13. while game.RunService.RenderStepped:Wait()do
  14. --pcall because fuck u there might be errors
  15. pcall(function()
  16. --main table of all enemy locations
  17. local a={}
  18. for _,v in pairs(game.Workspace.Players:GetChildren())do
  19. if v.Name~=game.Players.LocalPlayer.Team.Name then
  20. for _,c in pairs(v:GetChildren())do
  21. table.insert(a,c.HumanoidRootPart.Position)
  22. end
  23. end
  24. end
  25. if a[1]then
  26. --spawn and wait for grenades to be able to do damage
  27. game:GetService("ControllerService").RemoteEvent:FireServer("spawn")
  28. wait(.1)
  29. end
  30. if a[2]then
  31. --main thing to detect the closest 2 vectors
  32. local b={Vector3.new(),Vector3.new()}
  33. local c=math.huge
  34. for _,v in pairs(a)do
  35. for _,d in pairs(a)do
  36. if v~=d then
  37. if(v-d).Magnitude<c then
  38. c=(v-d).Magnitude
  39. b[1]=v
  40. b[2]=d
  41. end
  42. end
  43. end
  44. end
  45. if a[3]then
  46. --if there are 3 avalible targets nade the closest vector stuff and find 2 more random enemys
  47. local e={}
  48. for _=1,5 do
  49. local f=a[math.random(1,#a)]
  50. if not table.find(b,f)and not table.find(e,f)then
  51. table.insert(e,f)
  52. end
  53. if #e==2 then
  54. break
  55. end
  56. end
  57. for _,v in pairs(e)do
  58. Summoncum(v)
  59. end
  60. end
  61. Summoncum(b[1])
  62. elseif a[1]then
  63. Summoncum(a[1])
  64. end
  65. --respawn to reset the nade count
  66. wait(.1)
  67. game:GetService("ControllerService").RemoteEvent:FireServer("falldamage",69420)
  68. end)
  69. end
  70. --anti lag because fuck u hi-ping
  71. local mt=getrawmetatable(game)
  72. local oldNamecall=mt.__namecall
  73. local oldIndex=mt.__index
  74. setreadonly(mt,false)
  75. mt.__namecall=newcclosure(function(...)
  76. local method=getnamecallmethod()
  77. local args={...}
  78. if tostring(method)=="FireServer"then
  79. if args[2]~="votefromUI"and args[2]~="newgrenade"and args[2]~="falldamage"and args[2]~="spawn"and args[2]~="chatted"then
  80. return
  81. end
  82. end
  83. return oldNamecall(unpack(args))
  84. end)
Add Comment
Please, Sign In to add comment