Advertisement
Guest User

[FIXED PC] RAPID FIRE SCRIPT

a guest
Mar 9th, 2023
2,493
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2.  
  3. local LocalPlayer = Players.LocalPlayer
  4.  
  5. repeat task.wait()
  6. until game:GetService("ReplicatedStorage"):FindFirstChild("ShootEvent")
  7.  
  8. local ShootEvent = game:GetService("ReplicatedStorage").ShootEvent
  9. ShootEvent.Parent = workspace
  10. local FakeShootEvent = Instance.new("RemoteEvent",game:GetService("ReplicatedStorage"))
  11. FakeShootEvent.Name = "ShootEvent"
  12.  
  13. local function PickUp(Gun)
  14. workspace.Remote.ItemHandler:InvokeServer(workspace.Prison_ITEMS:FindFirstChild(Gun, true):FindFirstChildOfClass("Part"))
  15. end
  16.  
  17. local enable = true
  18.  
  19. Players.LocalPlayer.CharacterAdded:Connect(function(Character)
  20. if not enable then return end
  21. local Listed = {}
  22. Character.ChildAdded:Connect(function(Child)
  23. if not Listed[Child] and Child:IsA("Tool") then
  24. Listed[Child] = true
  25. local Module = Child:FindFirstChildOfClass("ModuleScript") and require(Child:FindFirstChildOfClass("ModuleScript"))
  26. if Module then
  27. task.spawn(function()
  28. repeat task.wait()
  29. Module.AutoFire = true
  30. Module.FireRate = 0
  31. Module.Spread = 100
  32. Module.StoredAmmo = math.huge
  33. Module.CurrentAmmo = math.huge
  34. Module.ReloadTime = 0
  35. game:GetService("ReplicatedStorage").ReloadEvent:FireServer(Child)
  36. until not Child or not Child.Parent
  37. end)
  38. end
  39. end
  40. end)
  41. end)
  42.  
  43. local YieldFunctionDelayed = 0.5
  44.  
  45. local Events = {}
  46. local Ticked = tick()
  47. local function YieldFunction()
  48. if tick()-Ticked < YieldFunctionDelayed then return end
  49. task.spawn(function()
  50. Ticked = tick()
  51. task.wait(YieldFunctionDelayed)
  52. local Gun = LocalPlayer.Character:FindFirstChildOfClass("Tool") or LocalPlayer.Backpack:FindFirstChild("Tool")
  53. if LocalPlayer.Character:FindFirstChild("Taser") then
  54. Gun = LocalPlayer.Character.Taser
  55. end
  56. ShootEvent:FireServer(Events, Gun)
  57. if Gun.Name ~= "Taser" then
  58. game:GetService("ReplicatedStorage").ReloadEvent:FireServer(Gun)
  59. end
  60. Events = {}
  61. end)
  62. end
  63.  
  64. MetamethodHook = hookmetamethod(game, "__namecall", function(...)
  65. if not enable then return end
  66. local Arguaments = {...}
  67. local Method = getnamecallmethod()
  68. if Method == "FireServer" and Arguaments[1] == FakeShootEvent then
  69. for i = 1,#Arguaments[2] do
  70. Events[#Events + 1] = Arguaments[2][i]
  71. end
  72. YieldFunction()
  73. return
  74. end
  75. return MetamethodHook(...)
  76. end)
  77.  
  78. LocalPlayer.Chatted:Connect(function(Message)
  79. if string.lower(Message) == "/disable" and enable then
  80. enable = false
  81. game:GetService("StarterGui"):SetCore("SendNotification",{
  82. Title = "LocalPlayer#7434",
  83. Text = "Rapid fire disabled!"
  84. })
  85. ShootEvent.Parent = game:GetService("ReplicatedStorage")
  86. FakeShootEvent:Destroy()
  87. end
  88. end)
  89.  
  90. game:GetService("StarterGui"):SetCore("SendNotification",{
  91. Title = "LocalPlayer#7434",
  92. Text = "Rapid fire enabled!"
  93. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement