Advertisement
Cizzy

Untitled

May 22nd, 2021
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.05 KB | None | 0 0
  1. game:GetService('RunService').Stepped:Connect(function()
  2. pcall(function()
  3. game.Players.LocalPlayer.PlayerGui.ScreenGui.Right.ScaleYY.Bottom.EQ.Ammo.Ammo.Text = '-1'
  4. require(game.Players.LocalPlayer.Character:FindFirstChildOfClass('Folder').config).AMMO = 2
  5. end)
  6. end)
  7.  
  8. function GetClosestPlayer()
  9. local Plr = nil
  10. local BestDis = math.huge
  11. for i, v in pairs(game.Players:GetPlayers()) do
  12. if v.Name ~= game.Players.LocalPlayer.Name then
  13. if v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Head") and v.Team ~= game.Players.LocalPlayer.Team then
  14. local Pos = game.Workspace.CurrentCamera:WorldToViewportPoint(v.Character.HumanoidRootPart.Position)
  15. local magnitude = (Vector2.new(Pos.X, Pos.Y) - Vector2.new(game.Players.LocalPlayer:GetMouse().X, game.Players.LocalPlayer:GetMouse().Y)).magnitude
  16. if magnitude < BestDis then
  17. Plr = v
  18. BestDis = magnitude
  19. end
  20. end
  21. end
  22. end
  23. return Plr
  24. end
  25. function HitTarget()
  26. pcall(function()
  27. game.Players.LocalPlayer.PlayerGui.ScreenGui.Center.ScaleYY.Middle.MouseIcon.TargetHitImage.ImageTransparency = 0.3;
  28. if not crossOn then
  29. crossOn = true
  30. delay(0.3, function()
  31. pcall(function()
  32. while game.Players.LocalPlayer.PlayerGui.ScreenGui.Center.ScaleYY.Middle.MouseIcon.TargetHitImage.ImageTransparency < 1 do
  33. wait(0.1);
  34. game.Players.LocalPlayer.PlayerGui.ScreenGui.Center.ScaleYY.Middle.MouseIcon.TargetHitImage.ImageTransparency = game:GetService("Players").LocalPlayer.PlayerGui.ScreenGui.Center.ScaleYY.Middle.MouseIcon.TargetHitImage.ImageTransparency + 0.1;
  35. end;
  36. crossOn = false;
  37. end)
  38. end)
  39. end
  40. end)
  41. end
  42. GameMeta = getrawmetatable(game)
  43. setreadonly(GameMeta,false)
  44. OldMt = GameMeta.__namecall
  45. GameMeta.__namecall = newcclosure(function(self,...)
  46. if getnamecallmethod() == 'FireServer' and tostring(self) == 'ChangeStat' then
  47. return
  48. end
  49. if getnamecallmethod() == 'FireServer' and tostring(self) == 'BulletEvent' and GetClosestPlayer() ~= nil then
  50. Args = {...}
  51. Target = GetClosestPlayer()
  52. if not Args[3] then
  53. return OldMt(self,...)
  54. end
  55. local v1 = {
  56. ["shotCode"] = { game.Workspace.CurrentCamera.CFrame.Position, (CFrame.new(game.Workspace.CurrentCamera.CFrame.p,Target.Character.Head.Position).LookVector) },
  57. ["target"] = Target,
  58. ["originObj"] = game.Players.LocalPlayer.Character:FindFirstChildOfClass('Folder'),
  59. ["bulletID"] = Args[3],
  60. ["pos"] = Target.Character.Head.Position
  61. }
  62. local rem = game:GetService("ReplicatedStorage").Remote.DmgEvent
  63. rem:FireServer(v1)
  64. HitTarget()
  65. return OldMt(self,...)
  66. end
  67. return OldMt(self,...)
  68. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement