-- This script was made by fashionjvnkie
local s = true
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local StarterGui = game:GetService("StarterGui")
local player = Players.LocalPlayer
if not player then player = Players.PlayerAdded:Wait() end
-- Device detection
local DEVICE_TYPE = "Mobile"
if UserInputService.MouseEnabled and UserInputService.KeyboardEnabled then
DEVICE_TYPE = "PC"
end
-- Notifications
StarterGui:SetCore("SendNotification", {
Title = "Executed",
Text = "",
Duration = 5
})
StarterGui:SetCore("SendNotification", {
Title = "Made solely by",
Text = "soul (@fashionjvnkie)",
Duration = 8
})
StarterGui:SetCore("SendNotification", {
Title = "Firerate Recommendation",
Text = "Recommended firerate: 0.065 - 0.075",
Duration = 8
})
StarterGui:SetCore("SendNotification", {
Title = "Need Help?",
Text = "DM @fashionjvnkie on Discord",
Duration = 8
})
local AUTO_GUNS = {"FAL", "MP5", "AK-47", "M4A1"}
local REMINGTON_NAME = "Remington 870"
local M9_NAME = "M9"
local C4_NAME = "C4"
-- Fixed timings
local REM_HOLD_TIME = 0.21
local AUTO_HOLD_TIME = 0.5
local M9_HOLD_TIME = 0.40
local TOTAL_CYCLE_TIME = math.max(REM_HOLD_TIME + AUTO_HOLD_TIME + M9_HOLD_TIME, 1.1)
local AUTO_GUN_COUNT = #AUTO_GUNS
-- Firerate with cooldown (recommended range)
local AUTO_FIRE_COOLDOWN = 0.07
local lastFireTime = 0
local SHOOT_INPUTS = {
Enum.UserInputType.MouseButton1,
Enum.KeyCode.LeftControl,
Enum.KeyCode.Space
}
local gui = Instance.new("ScreenGui")
gui.Name = "GunMacroGui"
gui.ResetOnSpawn = false
gui.Parent = player:WaitForChild("PlayerGui")
local mainBtn = Instance.new("TextButton")
mainBtn.Size = UDim2.fromOffset(180, 180)
mainBtn.Position = UDim2.new(0.88, 0, 0.7, 0)
mainBtn.AnchorPoint = Vector2.new(0.5, 0.5)
mainBtn.Text = "HOLD"
mainBtn.TextScaled = true
mainBtn.Font = Enum.Font.GothamBold
mainBtn.BackgroundColor3 = Color3.new(0.1, 0.1, 0.1)
mainBtn.BackgroundTransparency = 0.6
mainBtn.TextColor3 = Color3.new(1, 1, 1)
mainBtn.BorderSizePixel = 0
mainBtn.Parent = gui
Instance.new("UICorner", mainBtn).CornerRadius = UDim.new(1, 0)
local mainLock = Instance.new("TextButton")
mainLock.Size = UDim2.fromOffset(26, 26)
mainLock.Position = UDim2.new(1, -34, 0, 6)
mainLock.Text = "🔒"
mainLock.TextScaled = true
mainLock.BackgroundTransparency = 0.4
mainLock.BackgroundColor3 = Color3.fromRGB(180, 40, 40)
mainLock.Parent = mainBtn
Instance.new("UICorner", mainLock).CornerRadius = UDim.new(1, 0)
local function makeDraggable(element, lockButton)
local dragging = false
local dragInput = nil
local dragStart = nil
local startPos = nil
local locked = false
lockButton.MouseButton1Click:Connect(function()
locked = not locked
lockButton.BackgroundTransparency = locked and 0 or 0.4
end)
element.InputBegan:Connect(function(input)
if locked then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
dragStart = input.Position
startPos = element.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
element.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
RunService.RenderStepped:Connect(function()
if dragging and dragInput then
local delta = dragInput.Position - dragStart
element.Position = UDim2.new(
startPos.X.Scale,
startPos.X.Offset + delta.X,
startPos.Y.Scale,
startPos.Y.Offset + delta.Y
)
end
end)
end
makeDraggable(mainBtn, mainLock)
local isHolding = false
local cycleThread = nil
local currentAutoIndex = 1
local currentToolName = nil
local remingtonConnection = nil
local currentToolConnection = nil
local dragConnection = nil
local function getTool(name)
if not player.Character then return nil end
return player.Character:FindFirstChild(name) or player.Backpack:FindFirstChild(name)
end
local function equipTool(tool)
if not tool or (player.Character and player.Character:FindFirstChild(tool.Name)) then return end
local hum = player.Character:FindFirstChildOfClass("Humanoid")
if hum then
hum:EquipTool(tool)
currentToolName = tool.Name
end
end
local function unequipAll()
local hum = player.Character and player.Character:FindFirstChildOfClass("Humanoid")
if hum then
hum:UnequipTools()
currentToolName = nil
end
end
local function hasTool(name)
return getTool(name) ~= nil
end
local function isShooting()
for _, inputType in SHOOT_INPUTS do
if UserInputService:IsInputDown(inputType) then return true end
end
return false
end
local function isC4Equipped()
if not player.Character then return false end
return player.Character:FindFirstChild(C4_NAME) ~= nil
end
local function fireToolRemote(remote)
local now = tick()
if now - lastFireTime >= AUTO_FIRE_COOLDOWN then
remote:FireServer()
lastFireTime = now
end
end
local function setupRemingtonAutoFire(tool)
if remingtonConnection then remingtonConnection:Disconnect() end
if not tool or tool.Name ~= REMINGTON_NAME then return end
local remote = tool:FindFirstChild("Activate") or tool:FindFirstChild("Shoot")
if remote and remote:IsA("RemoteEvent") then
remingtonConnection = RunService.Heartbeat:Connect(function()
if isShooting() then fireToolRemote(remote) end
end)
end
end
local function setupAutoFire(tool)
if currentToolConnection then currentToolConnection:Disconnect() end
if not tool then return end
local remote = tool:FindFirstChild("Activate") or tool:FindFirstChild("Shoot")
if remote and remote:IsA("RemoteEvent") then
currentToolConnection = RunService.Heartbeat:Connect(function()
if isShooting() then fireToolRemote(remote) end
end)
end
end
local function updateButtonVisuals(holding)
TweenService:Create(mainBtn, TweenInfo.new(holding and 0.12 or 0.18), {
BackgroundColor3 = holding and Color3.fromRGB(40, 200, 100) or Color3.new(0.1, 0.1, 0.1),
BackgroundTransparency = holding and 0.35 or 0.6
}):Play()
mainBtn.Text = holding and "HOLDING" or "HOLD"
end
local function startMacro()
if cycleThread then task.cancel(cycleThread) end
cycleThread = task.spawn(function()
local startTime = tick()
while isHolding do
local elapsed = tick() - startTime
local cyclePos = elapsed % TOTAL_CYCLE_TIME
local targetToolName = nil
if hasTool(M9_NAME) then
if cyclePos < REM_HOLD_TIME then
targetToolName = REMINGTON_NAME
elseif cyclePos < REM_HOLD_TIME + AUTO_HOLD_TIME then
targetToolName = AUTO_GUNS[currentAutoIndex]
else
targetToolName = M9_NAME
end
else
targetToolName = cyclePos < REM_HOLD_TIME and REMINGTON_NAME or AUTO_GUNS[currentAutoIndex]
end
if targetToolName and targetToolName ~= currentToolName then
local tool = getTool(targetToolName)
if tool then
equipTool(tool)
if targetToolName == REMINGTON_NAME then
setupRemingtonAutoFire(tool)
else
setupAutoFire(tool)
end
end
end
if cyclePos >= TOTAL_CYCLE_TIME - 0.01 then
startTime = tick()
currentAutoIndex = 1
else
currentAutoIndex = (currentAutoIndex % AUTO_GUN_COUNT) + 1
end
task.wait(0.03)
end
end)
end
local function stopMacro()
if cycleThread then task.cancel(cycleThread) end
cycleThread = nil
if remingtonConnection then remingtonConnection:Disconnect() end
if currentToolConnection then currentToolConnection:Disconnect() end
unequipAll()
end
mainBtn.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.UserInputType ~= Enum.UserInputType.MouseButton1 and input.UserInputType ~= Enum.UserInputType.Touch then return end
-- C4 check only for PC players
if DEVICE_TYPE == "PC" and isC4Equipped() then return end
isHolding = true
updateButtonVisuals(true)
startMacro()
local mainLocked = mainLock.BackgroundTransparency == 0
if not mainLocked then
local dragStart = input.Position
local startPos = mainBtn.Position
dragConnection = UserInputService.InputChanged:Connect(function(inp)
if not isHolding then return end
if inp.UserInputType ~= Enum.UserInputType.MouseMovement and inp.UserInputType ~= Enum.UserInputType.Touch then return end
local delta = inp.Position - dragStart
mainBtn.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end)
end
end)
mainBtn.InputEnded:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.UserInputType ~= Enum.UserInputType.MouseButton1 and input.UserInputType ~= Enum.UserInputType.Touch then return end
isHolding = false
updateButtonVisuals(false)
stopMacro()
if dragConnection then
dragConnection:Disconnect()
dragConnection = nil
end
end)
local function onCharacterAdded(char)
task.wait(0.3)
updateButtonVisuals(false)
stopMacro()
if isHolding then
startMacro()
end
end
if player.Character then
task.spawn(onCharacterAdded, player.Character)
end
player.CharacterAdded:Connect(onCharacterAdded)
if s then
print("[GunMacro] Script loaded successfully!")
else
warn("[GunMacro] Script failed to load! Contact the OWNER for more INFO")
end
Comments
No comments yet
Be the first to share your thoughts!