abusabIe

tam

Jul 1st, 2019
648
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. function getDistances(chr, folder)
  2. local distances = {}
  3. for _, v in pairs(folder:GetChildren()) do
  4. if v:FindFirstChild("Head") then
  5. local part = v:IsA("BasePart") and v or v.PrimaryPart
  6. local dist = (part.Position - chr.HumanoidRootPart.Position).magnitude
  7. table.insert(distances, {v, dist})
  8. end
  9. end
  10. return distances
  11. end
  12.  
  13. local t = getrawmetatable(game.ReplicatedStorage.RE)
  14. local oldNamecall = t.__namecall
  15. setreadonly(t, false)
  16. t.__namecall = function(...)
  17. local a = {...}
  18. local fire
  19. if a[#a] == "FireServer" then
  20. fire = true
  21. end
  22. if a[2] ~= "FailedSpawnCheck" then
  23. if fire then
  24. if a[2] == "PlaceFortification" then
  25. a[3].FortName = "50 Cal"
  26. a[3].PlaceCF = a[3].PlaceCF + Vector3.new(0,1,0)
  27. elseif a[2] == "GenerateAreaEffect" then
  28. a[3].Name = "Molotov"
  29. end
  30. local ais = {}
  31. pcall(function()
  32. ais = a[3].AIs
  33. end)
  34. if ais and #ais > 0 then
  35. local vel = ais[1].Velocity
  36. local distances = getDistances(game.Players.LocalPlayer.Character, workspace.Infected)
  37. table.sort(distances, function(a,b)
  38. return a[2] < b[2]
  39. end)
  40. ais[1].Damage = 300
  41. ais[1].Special = "Headshot"
  42. local ai1 = ais[1]
  43. local newAis = {ai1}
  44. for i,v in ipairs(distances) do
  45. if i > 5 then break end
  46. if v[1] ~= ai1.AI then
  47. table.insert(newAis, {AI = v[1], Velocity = vel, Special = "Headshot", Damage = 300})
  48. end
  49. end
  50. a[3].AIs = newAis--]]
  51. end
  52. end
  53. return oldNamecall(unpack(a))
  54. end
  55. end
Advertisement
Add Comment
Please, Sign In to add comment