--BROUGHT TO YOU BY RobloxScripter.com!--
local check_func = is_synapse_function -- change this if it doesnt work (checkclosure should work on scriptware)
local LASER_GUN_ENABLED = true
local GUN_DEBOUNCE_ENABLED = false
-- just dont touch anything below its shit but it works
local UserInputService = game:GetService("UserInputService")
local PlayersService = game:GetService("Players")
local LocalPlayer = PlayersService.LocalPlayer
local function Handle()
for _, v in ipairs(getgc()) do
if type(v) == "function" then
if debug.info(v, "n") == "fireGun" and not GUN_DEBOUNCE_ENABLED then
debug.setconstant(v, 5, 0)
else
local info = debug.getinfo(v)
if not check_func(v) and info.currentline == 76 and info.source ~= "SXDecompiler" and LASER_GUN_ENABLED then
local originalFunc
originalFunc = hookfunction(v, function(input, gameProcessedEvent)
repeat
originalFunc(input, gameProcessedEvent)
task.wait()
until not UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1)
end)
end
end
end
end
end
local HandledGuns = {}
LocalPlayer.ChildAdded:Connect(function(child)
if child.ClassName == "Backpack" then
local child = child:FindFirstChild("Gun") or child.ChildAdded:Wait()
if not HandledGuns[child] and child.Name == "Gun" then
HandledGuns[child] = true
task.delay(3, Handle) -- For some reason synapse's hookfunction is extremely unstable
local ancestryConnection
ancestryConnection = child:GetPropertyChangedSignal("Parent"):Connect(function()
if not child.Parent then
ancestryConnection:Disconnect()
ancestryConnection = nil
HandledGuns[child] = nil
end
end)
end
end
end)
Handle()