epicllllllllllllllll

prisonliferapidfireguiversion

Mar 16th, 2024
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.99 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local LocalPlayer = Players.LocalPlayer
  3. local UIS = game:GetService("UserInputService")
  4.  
  5. -- Define the GUI
  6. local ScreenGui = Instance.new("ScreenGui")
  7. ScreenGui.Name = "RapidFireGUI"
  8. ScreenGui.Parent = game.CoreGui
  9.  
  10. local ToggleButton = Instance.new("TextButton")
  11. ToggleButton.Name = "ToggleButton"
  12. ToggleButton.Size = UDim2.new(0, 100, 0, 50)
  13. ToggleButton.Position = UDim2.new(0.5, -50, 0, 50)
  14. ToggleButton.Text = "Toggle Rapid Fire"
  15. ToggleButton.Parent = ScreenGui
  16.  
  17. -- Define the function to toggle rapid fire
  18. local function ToggleRapidFire()
  19. enable = not enable
  20. if enable then
  21. game:GetService("StarterGui"):SetCore("SendNotification", {
  22. Title = "LocalPlayer#7434",
  23. Text = "Rapid fire enabled!"
  24. })
  25. else
  26. game:GetService("StarterGui"):SetCore("SendNotification", {
  27. Title = "LocalPlayer#7434",
  28. Text = "Rapid fire disabled!"
  29. })
  30. ShootEvent.Parent = game:GetService("ReplicatedStorage")
  31. FakeShootEvent:Destroy()
  32. end
  33. end
  34.  
  35. -- Connect the button to the toggle function
  36. ToggleButton.MouseButton1Click:Connect(ToggleRapidFire)
  37.  
  38. repeat task.wait() until game:GetService("ReplicatedStorage"):FindFirstChild("ShootEvent")
  39.  
  40. local ShootEvent = game:GetService("ReplicatedStorage").ShootEvent
  41. ShootEvent.Parent = workspace
  42. local FakeShootEvent = Instance.new("RemoteEvent", game:GetService("ReplicatedStorage"))
  43. FakeShootEvent.Name = "ShootEvent"
  44.  
  45. local function PickUp(Gun)
  46. workspace.Remote.ItemHandler:InvokeServer(workspace.Prison_ITEMS:FindFirstChild(Gun, true):FindFirstChildOfClass("Part"))
  47. end
  48.  
  49. local enable = true
  50.  
  51. Players.LocalPlayer.CharacterAdded:Connect(function(Character)
  52. if not enable then return end
  53. local Listed = {}
  54. Character.ChildAdded:Connect(function(Child)
  55. if not Listed[Child] and Child:IsA("Tool") then
  56. Listed[Child] = true
  57. local Module = Child:FindFirstChildOfClass("ModuleScript") and require(Child:FindFirstChildOfClass("ModuleScript"))
  58. if Module then
  59. task.spawn(function()
  60. repeat task.wait()
  61. Module.AutoFire = true
  62. Module.FireRate = 0
  63. Module.Spread = 100
  64. Module.StoredAmmo = math.huge
  65. Module.CurrentAmmo = math.huge
  66. Module.ReloadTime = 0
  67. Module.Bullets = 20
  68. game:GetService("ReplicatedStorage").ReloadEvent:FireServer(Child)
  69. until not Child or not Child.Parent
  70. end)
  71. end
  72. end
  73. end)
  74. end)
  75.  
  76. local YieldFunctionDelayed = 0.5
  77.  
  78. local Events = {}
  79. local Ticked = tick()
  80. local function YieldFunction()
  81. if tick() - Ticked < YieldFunctionDelayed then return end
  82. task.spawn(function()
  83. Ticked = tick()
  84. task.wait(YieldFunctionDelayed)
  85. local Gun = LocalPlayer.Character:FindFirstChildOfClass("Tool") or LocalPlayer.Backpack:FindFirstChild("Tool")
  86. if LocalPlayer.Character:FindFirstChild("Taser") then
  87. Gun = LocalPlayer.Character.Taser
  88. end
  89. ShootEvent:FireServer(Events, Gun)
  90. if Gun.Name ~= "Taser" then
  91. game:GetService("ReplicatedStorage").ReloadEvent:FireServer(Gun)
  92. end
  93. Events = {}
  94. end)
  95. end
  96.  
  97. MetamethodHook = hookmetamethod(game, "__namecall", function(...)
  98. if not enable then return end
  99. local Arguments = {...}
  100. local Method = getnamecallmethod()
  101. if Method == "FireServer" and Arguments[1] == FakeShootEvent then
  102. for i = 1, #Arguments[2] do
  103. Events[#Events + 1] = Arguments[2][i]
  104. end
  105. YieldFunction()
  106. return
  107. end
  108. return MetamethodHook(...)
  109. end)
  110.  
  111. LocalPlayer.Chatted:Connect(function(Message)
  112. if string.lower(Message) == "/disable" and enable then
  113. enable = false
  114. game:GetService("StarterGui"):SetCore("SendNotification", {
  115. Title = "LocalPlayer#7434",
  116. Text = "Rapid fire disabled!"
  117. })
  118. ShootEvent.Parent = game:GetService("ReplicatedStorage")
  119. FakeShootEvent:Destroy()
  120. end
  121. end)
  122.  
  123. game:GetService("StarterGui"):SetCore("SendNotification", {
  124. Title = "LocalPlayer#7434",
  125. Text = "Rapid fire enabled!"
  126. })
  127.  
  128. -- Hide and unhide GUI with "M" key
  129. local function onKeyPress(input)
  130. if input.KeyCode == Enum.KeyCode.M then
  131. ScreenGui.Enabled = not ScreenGui.Enabled
  132. end
  133. end
  134. UIS.InputBegan:Connect(onKeyPress)
  135.  
  136. -- Function to slowly change GUI colors in a random manner
  137. local function ChangeGuiColor()
  138. while true do
  139. local r = math.random()
  140. local g = math.random()
  141. local b = math.random()
  142. ScreenGui.ToggleButton.BackgroundColor3 = Color3.new(r, g, b)
  143. task.wait(1) -- Adjust the wait time to change colors more or less frequently
  144. end
  145. end
  146. task.spawn(ChangeGuiColor)
  147.  
Advertisement
Add Comment
Please, Sign In to add comment