Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local UIS = game:GetService("UserInputService")
- -- Define the GUI
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Name = "RapidFireGUI"
- ScreenGui.Parent = game.CoreGui
- local ToggleButton = Instance.new("TextButton")
- ToggleButton.Name = "ToggleButton"
- ToggleButton.Size = UDim2.new(0, 100, 0, 50)
- ToggleButton.Position = UDim2.new(0.5, -50, 0, 50)
- ToggleButton.Text = "Toggle Rapid Fire"
- ToggleButton.Parent = ScreenGui
- -- Define the function to toggle rapid fire
- local function ToggleRapidFire()
- enable = not enable
- if enable then
- game:GetService("StarterGui"):SetCore("SendNotification", {
- Title = "LocalPlayer#7434",
- Text = "Rapid fire enabled!"
- })
- else
- game:GetService("StarterGui"):SetCore("SendNotification", {
- Title = "LocalPlayer#7434",
- Text = "Rapid fire disabled!"
- })
- ShootEvent.Parent = game:GetService("ReplicatedStorage")
- FakeShootEvent:Destroy()
- end
- end
- -- Connect the button to the toggle function
- ToggleButton.MouseButton1Click:Connect(ToggleRapidFire)
- repeat task.wait() until game:GetService("ReplicatedStorage"):FindFirstChild("ShootEvent")
- local ShootEvent = game:GetService("ReplicatedStorage").ShootEvent
- ShootEvent.Parent = workspace
- local FakeShootEvent = Instance.new("RemoteEvent", game:GetService("ReplicatedStorage"))
- FakeShootEvent.Name = "ShootEvent"
- local function PickUp(Gun)
- workspace.Remote.ItemHandler:InvokeServer(workspace.Prison_ITEMS:FindFirstChild(Gun, true):FindFirstChildOfClass("Part"))
- end
- local enable = true
- Players.LocalPlayer.CharacterAdded:Connect(function(Character)
- if not enable then return end
- local Listed = {}
- Character.ChildAdded:Connect(function(Child)
- if not Listed[Child] and Child:IsA("Tool") then
- Listed[Child] = true
- local Module = Child:FindFirstChildOfClass("ModuleScript") and require(Child:FindFirstChildOfClass("ModuleScript"))
- if Module then
- task.spawn(function()
- repeat task.wait()
- Module.AutoFire = true
- Module.FireRate = 0
- Module.Spread = 100
- Module.StoredAmmo = math.huge
- Module.CurrentAmmo = math.huge
- Module.ReloadTime = 0
- Module.Bullets = 20
- game:GetService("ReplicatedStorage").ReloadEvent:FireServer(Child)
- until not Child or not Child.Parent
- end)
- end
- end
- end)
- end)
- local YieldFunctionDelayed = 0.5
- local Events = {}
- local Ticked = tick()
- local function YieldFunction()
- if tick() - Ticked < YieldFunctionDelayed then return end
- task.spawn(function()
- Ticked = tick()
- task.wait(YieldFunctionDelayed)
- local Gun = LocalPlayer.Character:FindFirstChildOfClass("Tool") or LocalPlayer.Backpack:FindFirstChild("Tool")
- if LocalPlayer.Character:FindFirstChild("Taser") then
- Gun = LocalPlayer.Character.Taser
- end
- ShootEvent:FireServer(Events, Gun)
- if Gun.Name ~= "Taser" then
- game:GetService("ReplicatedStorage").ReloadEvent:FireServer(Gun)
- end
- Events = {}
- end)
- end
- MetamethodHook = hookmetamethod(game, "__namecall", function(...)
- if not enable then return end
- local Arguments = {...}
- local Method = getnamecallmethod()
- if Method == "FireServer" and Arguments[1] == FakeShootEvent then
- for i = 1, #Arguments[2] do
- Events[#Events + 1] = Arguments[2][i]
- end
- YieldFunction()
- return
- end
- return MetamethodHook(...)
- end)
- LocalPlayer.Chatted:Connect(function(Message)
- if string.lower(Message) == "/disable" and enable then
- enable = false
- game:GetService("StarterGui"):SetCore("SendNotification", {
- Title = "LocalPlayer#7434",
- Text = "Rapid fire disabled!"
- })
- ShootEvent.Parent = game:GetService("ReplicatedStorage")
- FakeShootEvent:Destroy()
- end
- end)
- game:GetService("StarterGui"):SetCore("SendNotification", {
- Title = "LocalPlayer#7434",
- Text = "Rapid fire enabled!"
- })
- -- Hide and unhide GUI with "M" key
- local function onKeyPress(input)
- if input.KeyCode == Enum.KeyCode.M then
- ScreenGui.Enabled = not ScreenGui.Enabled
- end
- end
- UIS.InputBegan:Connect(onKeyPress)
- -- Function to slowly change GUI colors in a random manner
- local function ChangeGuiColor()
- while true do
- local r = math.random()
- local g = math.random()
- local b = math.random()
- ScreenGui.ToggleButton.BackgroundColor3 = Color3.new(r, g, b)
- task.wait(1) -- Adjust the wait time to change colors more or less frequently
- end
- end
- task.spawn(ChangeGuiColor)
Advertisement
Add Comment
Please, Sign In to add comment