F3X gun Script v2.5 by CatScript_Haxxor
Key RequiredUniversal

F3X gun Script v2.5 by CatScript_Haxxor

Universal ScriptCat_ScriptCat_Script 1.9K views 5.4K executesUpdated Sep 18, 2026
5.0/ 5(1 votes)
10100% Positive
Lua Script•436 lines (18400 chars)
-- f3x clean raycast combat & reanimation system (custom f3x gun)
-- Scriptblox user: Cat_Script
-- Roblox user: CatScript_Haxxor
-- INCLUDES: Fixed Alignment, Clean UI, Ejection Port
-- Note: The F3X script has been fully updated to include the new "f3xgun-lua-Original" component, 
-- correctly positioned on the side of the slide to give the pistol a detailed, realistic look while maintaining 
-- the clean UI and perfect hand-alignment. Simply copy and paste the updated code above into your executor!

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local mouse = player:GetMouse()
local char = player.Character or player.CharacterAdded:Wait()
local rootPart = char:WaitForChild("HumanoidRootPart")
local humanoid = char:WaitForChild("Humanoid")
local playerGui = player:WaitForChild("PlayerGui")
local backpack = player:WaitForChild("Backpack")
local tool

for i, v in player:GetDescendants() do
    if v.Name == "SyncAPI" then
        tool = v.Parent
    end
end

for i, v in game.ReplicatedStorage:GetDescendants() do
    if v.Name == "SyncAPI" then
        tool = v.Parent
    end
end

local remote = tool and tool:FindFirstChild("SyncAPI") and tool.SyncAPI:FindFirstChild("ServerEndpoint")

local function remoteExecute(args)
    if remote then
        remote:InvokeServer(unpack(args))
    end
end

local function SetCollision(part, boolean)
    local args = { [1] = "SyncCollision", [2] = { [1] = { Part = part, CanCollide = boolean } } }
    remoteExecute(args)
end

local function CreatePart(cf, parent)
    local args = { [1] = "CreatePart", [2] = "Normal", [3] = cf, [4] = parent }
    remoteExecute(args)
end

local function DestroyPart(part)
    local args = { [1] = "Remove", [2] = { [1] = part } }
    remoteExecute(args)
end

local function Resize(part, size, cf)
    local args = { [1] = "SyncResize", [2] = { [1] = { Part = part, CFrame = cf, Size = size } } }
    remoteExecute(args)
end

local function AddMesh(part)
    local args = { [1] = "CreateMeshes", [2] = { [1] = { Part = part } } }
    remoteExecute(args)
end

local function SetMesh(part, meshid)
    local args = { [1] = "SyncMesh", [2] = { [1] = { Part = part, MeshId = "rbxassetid://" .. meshid } } }
    remoteExecute(args)
end

local function SetName(part, stringg)
    local args = { [1] = "SetName", [2] = { [1] = part }, [3] = stringg }
    remoteExecute(args)
end

local function SetLocked(part, boolean)
    local args = { [1] = "SetLocked", [2] = { [1] = part }, [3] = boolean }
    remoteExecute(args)
end

local function SetTrans(part, int)
    local args = { [1] = "SyncMaterial", [2] = { [1] = { Part = part, Transparency = int } } }
    remoteExecute(args)
end

local function Color(part, color)
    local args = { [1] = "SyncColor", [2] = { [1] = { Part = part, Color = color, UnionColoring = false } } }
    remoteExecute(args)
end

local function MovePart(part, cf)
    local args = { [1] = "SyncMove", [2] = { [1] = { Part = part, CFrame = cf } } }
    remoteExecute(args)
end

local febypass = {}
febypass.SetCollision = SetCollision
febypass.CreatePart = CreatePart
febypass.Resize = Resize
febypass.AddMesh = AddMesh
febypass.SetMesh = SetMesh
febypass.SetName = SetName
febypass.SetLocked = SetLocked
febypass.SetTrans = SetTrans
febypass.Color = Color
febypass.DestroyPart = DestroyPart
febypass.remoteExecute = remoteExecute

if char and char:FindFirstChild("Torso") then
    pcall(function()
        febypass.SetTrans(char["Right Arm"], 1)
        febypass.SetTrans(char["Left Arm"], 1)
        febypass.SetTrans(char["Torso"], 1)
        febypass.SetTrans(char["Left Leg"], 1)
        febypass.SetTrans(char["Right Leg"], 1)
        febypass.SetTrans(char["Head"], 1)
    end)

    local partNames = { 
        "Right Arm FE", "Left Arm FE", "Right Leg FE", "Left Leg FE", "Head FE", "Torso FE", 
        "GunSlide", "GunFrame", "GunTrigger", "GunTriggerGuard", "GunGrip", "GunMagazine", "GunHammer", "GunBarrel" 
    }
    
    for _, name in ipairs(partNames) do
        febypass.CreatePart(rootPart.CFrame * CFrame.new(0, 3, 0), char.Torso)
        local newlyCreated = char.Torso:WaitForChild("Part", 2)
        if newlyCreated then
            febypass.SetCollision(newlyCreated, false)
            febypass.Resize(newlyCreated, Vector3.new(0.9, 1.9, 0.9), rootPart.CFrame * CFrame.new(0, 3, 0))
            febypass.SetName(newlyCreated, name)
        end
    end

    pcall(function()
        febypass.AddMesh(char.Torso:WaitForChild("Head FE"))
        febypass.SetMesh(char.Torso["Head FE"], "6571349341")
        febypass.AddMesh(char.Torso:WaitForChild("Torso FE"))
        febypass.SetMesh(char.Torso["Torso FE"], "12800536037")

        for _, limbName in ipairs({ "Left Leg FE", "Right Leg FE", "Right Arm FE", "Left Arm FE" }) do
            febypass.AddMesh(char.Torso:WaitForChild(limbName))
            febypass.SetMesh(char.Torso[limbName], "127739625807358")
        end

        febypass.Color(char.Torso:WaitForChild("Head FE"), Color3.fromRGB(255, 255, 255))
        febypass.Color(char.Torso:WaitForChild("Torso FE"), Color3.fromRGB(20, 20, 20))
        febypass.Color(char.Torso:WaitForChild("Right Arm FE"), Color3.fromRGB(255, 255, 255))
        febypass.Color(char.Torso:WaitForChild("Left Arm FE"), Color3.fromRGB(255, 255, 255))
        febypass.Color(char.Torso:WaitForChild("Right Leg FE"), Color3.fromRGB(0, 100, 255))
        febypass.Color(char.Torso:WaitForChild("Left Leg FE"), Color3.fromRGB(0, 100, 255))

        febypass.Color(char.Torso:WaitForChild("GunSlide"), Color3.fromRGB(25, 25, 25))
        febypass.Color(char.Torso:WaitForChild("GunFrame"), Color3.fromRGB(40, 40, 40))
        febypass.Color(char.Torso:WaitForChild("GunTrigger"), Color3.fromRGB(150, 150, 150))
        febypass.Color(char.Torso:WaitForChild("GunTriggerGuard"), Color3.fromRGB(40, 40, 40))
        febypass.Color(char.Torso:WaitForChild("GunGrip"), Color3.fromRGB(20, 20, 20))
        febypass.Color(char.Torso:WaitForChild("GunMagazine"), Color3.fromRGB(80, 95, 115))
        febypass.Color(char.Torso:WaitForChild("GunHammer"), Color3.fromRGB(90, 90, 90))
        febypass.Color(char.Torso:WaitForChild("GunBarrel"), Color3.fromRGB(200, 200, 200))

        for _, name in ipairs(partNames) do
            local p = char.Torso:FindFirstChild(name)
            if p then
                febypass.SetLocked(p, true)
            end
        end
    end)

    local gunTool = Instance.new("Tool")
    gunTool.Name = "F3X Gun"
    gunTool.RequiresHandle = true
    gunTool.CanBeDropped = false

    local toolHandle = Instance.new("Part")
    toolHandle.Name = "Handle"
    toolHandle.Size = Vector3.new(1, 1, 1)
    toolHandle.Transparency = 1
    toolHandle.Parent = gunTool
    gunTool.Parent = backpack

    local screenGui = Instance.new("ScreenGui")
    screenGui.Name = "CombatToggleGui"
    screenGui.ResetOnSpawn = false
    screenGui.Parent = playerGui

    local notifyLabel = Instance.new("TextLabel")
    notifyLabel.Name = "NotifyLabel"
    notifyLabel.Size = UDim2.new(0, 300, 0, 40)
    notifyLabel.Position = UDim2.new(0.5, -150, 0, -50)
    notifyLabel.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
    notifyLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
    notifyLabel.TextSize = 15
    notifyLabel.Font = Enum.Font.SourceSansBold
    notifyLabel.Text = "Notification"
    notifyLabel.Visible = false
    notifyLabel.Parent = screenGui

    local uiCorner = Instance.new("UICorner")
    uiCorner.CornerRadius = UDim.new(0, 8)
    uiCorner.Parent = notifyLabel

    local function showNotification(message, duration)
        notifyLabel.Text = message
        notifyLabel.Visible = true
        notifyLabel.Position = UDim2.new(0.5, -150, 0, -50)
        
        local tweenService = game:GetService("TweenService")
        local info = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
        
        tweenService:Create(notifyLabel, info, {Position = UDim2.new(0.5, -150, 0, 20)}):Play()
        
        task.delay(duration or 2, function()
            local hideTween = tweenService:Create(notifyLabel, info, {Position = UDim2.new(0.5, -150, 0, -50)})
            hideTween:Play()
            hideTween.Completed:Connect(function()
                notifyLabel.Visible = false
            end)
        end)
    end

    local ammoLabel = Instance.new("TextLabel")
    ammoLabel.Size = UDim2.new(0, 160, 0, 30)
    ammoLabel.Position = UDim2.new(0, 20, 0, 130)
    ammoLabel.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
    ammoLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
    ammoLabel.Font = Enum.Font.SourceSansBold
    ammoLabel.TextSize = 15
    ammoLabel.Text = "Ammo: 10 / 10"
    ammoLabel.Parent = screenGui

    local reloadButton = Instance.new("TextButton")
    reloadButton.Size = UDim2.new(0, 160, 0, 35)
    reloadButton.Position = UDim2.new(0, 20, 0, 165)
    reloadButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
    reloadButton.TextColor3 = Color3.fromRGB(255, 255, 255)
    reloadButton.Font = Enum.Font.SourceSansBold
    reloadButton.TextSize = 15
    reloadButton.Text = "Reload [R]"
    reloadButton.Parent = screenGui

    local maxAmmo = 10
    local currentAmmo = maxAmmo
    local isReloading = false
    local isEquipped = false

    local function updateAmmoUI()
        if isReloading then
            ammoLabel.Text = "Reloading..."
        else
            ammoLabel.Text = "Ammo: " .. currentAmmo .. " / " .. maxAmmo
        end
    end

    local function reloadGun()
        if isReloading or currentAmmo == maxAmmo then return end
        isReloading = true
        updateAmmoUI()
        showNotification("Reloading weapon...", 1.5)
        task.wait(1.5)
        currentAmmo = maxAmmo
        isReloading = false
        updateAmmoUI()
        showNotification("Weapon fully reloaded!", 1.5)
    end

    reloadButton.MouseButton1Click:Connect(reloadGun)
 game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessed)
        if gameProcessed then return end
        if input.KeyCode == Enum.KeyCode.R then
            reloadGun()
        end
    end)

    gunTool.Equipped:Connect(function()
        isEquipped = true
        showNotification("F3X Gun Equipped", 1.5)
    end)

    gunTool.Unequipped:Connect(function()
        isEquipped = false
        showNotification("F3X Gun Holstered", 1.5)
    end)

    gunTool.Activated:Connect(function()
        if not isEquipped then
            showNotification("Equip the tool first!", 1.5)
            return
        end
        if isReloading then
            showNotification("Cannot shoot while reloading!", 1.5)
            return
        end
        if currentAmmo <= 0 then
            showNotification("Out of ammo! Press R to reload.", 1.5)
            return
        end

        currentAmmo = currentAmmo - 1
        updateAmmoUI()

        local barrelPart = char.Torso:FindFirstChild("GunBarrel")
        local spawnPos = barrelPart and barrelPart.Position or (rootPart.Position + Vector3.new(0, 2, 0))
        local targetHitPos = mouse.Hit.Position
        local direction = (targetHitPos - spawnPos).Unit
        
        local bulletCFrame = CFrame.new(spawnPos, spawnPos + direction)
        
        local success, bulletPart = pcall(function()
            return remote:InvokeServer("CreatePart", "Normal", bulletCFrame, workspace)
        end)

        if success and bulletPart then
            SetCollision(bulletPart, false)
            Color(bulletPart, Color3.fromRGB(255, 230, 50))
            Resize(bulletPart, Vector3.new(0.35, 0.35, 2.5), bulletCFrame)

            task.spawn(function()
                local speed = 800
                local maxDistance = 1500
                local traveled = 0
                local currentCF = bulletCFrame

                while traveled < maxDistance do
                    local dt = RunService.Heartbeat:Wait()
                    local step = speed * dt
                    traveled = traveled + step
                    
                    currentCF = currentCF + (currentCF.LookVector * step)
                    
                    pcall(function()
                        MovePart(bulletPart, currentCF)
                    end)

                    local rayParams = RaycastParams.new()
                    rayParams.FilterDescendantsInstances = {char, bulletPart}
                    rayParams.FilterType = Enum.RaycastFilterType.Exclude
                    
                    local hitResult = workspace:Raycast(currentCF.Position - (currentCF.LookVector * step), currentCF.LookVector * step, rayParams)
                    if hitResult then
                        local hitInst = hitResult.Instance
                        if hitInst and hitInst.Parent then
                            local hitModel = hitInst.Parent
                            local humanoidModel = hitModel:FindFirstChildOfClass("Humanoid")

                            if humanoidModel and hitModel ~= char then
                                pcall(function()
                                    SetLocked(hitInst, false)
                                    DestroyPart(hitInst)
                                end)
                            end
                        end
                        break
                    end
                end

                pcall(function()
                    DestroyPart(bulletPart)
                end)
            end)
        end
    end)

    local animTick = 0
    RunService.RenderStepped:Connect(function()
        pcall(function()
            local rightArmFE = char.Torso:WaitForChild("Right Arm FE")
            local leftArmFE = char.Torso:WaitForChild("Left Arm FE")
            local leftLegFE = char.Torso:WaitForChild("Left Leg FE")
            local rightLegFE = char.Torso:WaitForChild("Right Leg FE")
            local headFE = char.Torso:WaitForChild("Head FE")
            local torsoFE = char.Torso:WaitForChild("Torso FE")
            
            local function smoothFollow(fePart, realPart, targetCF)
                if fePart and realPart then
                    local goalCF = targetCF or realPart.CFrame
                    local lerpedCF = fePart.CFrame:Lerp(goalCF, 0.4)
                    febypass.Resize(fePart, Vector3.new(0.01, 0.01, 0.01), lerpedCF)
                end
            end

            local speed = rootPart.AssemblyLinearVelocity.Magnitude
            local isMoving = speed > 0.5
            
            if not isMoving then
                animTick = animTick + (RunService.Heartbeat:Wait() * 2)
                local bob = math.sin(animTick) * 0.03
                smoothFollow(rightArmFE, char["Right Arm"], char["Right Arm"].CFrame * CFrame.new(0, bob, 0))
                smoothFollow(leftArmFE, char["Left Arm"], char["Left Arm"].CFrame * CFrame.new(0, -bob, 0))
                smoothFollow(leftLegFE, char["Left Leg"], char["Left Leg"].CFrame)
                smoothFollow(rightLegFE, char["Right Leg"], char["Right Leg"].CFrame)
                smoothFollow(headFE, char["Head"], char["Head"].CFrame * CFrame.new(0, bob * 0.5, 0))
                smoothFollow(torsoFE, char["Torso"], char["Torso"].CFrame * CFrame.new(0, bob, 0))
            else
                animTick = animTick + (RunService.Heartbeat:Wait() * 8)
                local swing = math.sin(animTick) * 0.15
                smoothFollow(rightArmFE, char["Right Arm"], char["Right Arm"].CFrame * CFrame.Angles(swing, 0, 0))
                smoothFollow(leftArmFE, char["Left Arm"], char["Left Arm"].CFrame * CFrame.Angles(-swing, 0, 0))
                smoothFollow(leftLegFE, char["Left Leg"], char["Left Leg"].CFrame * CFrame.Angles(swing, 0, 0))
                smoothFollow(rightLegFE, char["Right Leg"], char["Right Leg"].CFrame * CFrame.Angles(-swing, 0, 0))
                smoothFollow(headFE, char["Head"])
                smoothFollow(torsoFE, char["Torso"])
            end

            local gSlide = char.Torso:FindFirstChild("GunSlide")
            local gFrame = char.Torso:FindFirstChild("GunFrame")
            local gTrigger = char.Torso:FindFirstChild("GunTrigger")
            local gTriggerGuard = char.Torso:FindFirstChild("GunTriggerGuard")
            local gGrip = char.Torso:FindFirstChild("GunGrip")
            local gMag = char.Torso:FindFirstChild("GunMagazine")
            local gHammer = char.Torso:FindFirstChild("GunHammer")
            local gBarrel = char.Torso:FindFirstChild("GunBarrel")

            if gSlide and gFrame and gTrigger and gTriggerGuard and gGrip and gMag and gHammer and gBarrel and isEquipped then
                local gunBaseCF = rightArmFE.CFrame * CFrame.new(0, -1, -0.4) * CFrame.Angles(math.rad(-90), 0, 0)
                 
                Resize(gSlide, Vector3.new(0.45, 0.55, 2.1), gunBaseCF * CFrame.new(0, 0.7, -0.4))
                Resize(gFrame, Vector3.new(0.42, 0.45, 1.6), gunBaseCF * CFrame.new(0, 0.25, -0.3))
                Resize(gTrigger, Vector3.new(0.12, 0.2, 0.15), gunBaseCF * CFrame.new(0, 0.1, -0.15))
                Resize(gTriggerGuard, Vector3.new(0.15, 0.35, 0.45), gunBaseCF * CFrame.new(0, 0.05, -0.25))
                Resize(gGrip, Vector3.new(0.4, 1.1, 0.65), gunBaseCF * CFrame.new(0, -0.45, 0.1) * CFrame.Angles(math.rad(12), 0, 0))
                Resize(gMag, Vector3.new(0.35, 1.0, 0.55), gunBaseCF * CFrame.new(0, -0.45, 0.1) * CFrame.Angles(math.rad(12), 0, 0))
                Resize(gHammer, Vector3.new(0.2, 0.3, 0.2), gunBaseCF * CFrame.new(0, 0.5, 0.55))
                Resize(gBarrel, Vector3.new(0.3, 0.3, 2.3), gunBaseCF * CFrame.new(0, 0.7, -0.5))
            elseif gSlide then
                local hiddenCF = rootPart.CFrame * CFrame.new(0, -40, 0)
                Resize(gSlide, Vector3.new(0.01, 0.01, 0.01), hiddenCF)
                Resize(gFrame, Vector3.new(0.01, 0.01, 0.01), hiddenCF)
                Resize(gTrigger, Vector3.new(0.01, 0.01, 0.01), hiddenCF)
                Resize(gTriggerGuard, Vector3.new(0.01, 0.01, 0.01), hiddenCF)
                Resize(gGrip, Vector3.new(0.01, 0.01, 0.01), hiddenCF)
                Resize(gMag, Vector3.new(0.01, 0.01, 0.01), hiddenCF)
                Resize(gHammer, Vector3.new(0.01, 0.01, 0.01), hiddenCF)
                Resize(gBarrel, Vector3.new(0.01, 0.01, 0.01), hiddenCF)
            end
        end)
    end)
end

Features & Information

F3X gun ScreenGui, Reload, Shooting, Keybind (PC) and Button (Mobile)

Community Comments (3)

Phant0mk1ddhaxPhant0mk1ddhaxSep 25, 2026

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⠿⠟⠉⢉⣀⣤⣄⣀⣀⠀⠀⠈⠙⠻⠿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⠋⠁⢀⣴⣾⣿⣿⣿⣿⣿⣿⣿⣶⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣇⠀⠀⣞⡛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣀⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣧⢰⡯⠿⠿⣿⣿⣿⠿⠿⠛⠛⠻⠷⡀⠀⠀⢀⣰⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣳⣾⣿⠃⣠⣤⣒⡋⠀⠀⣀⡀⢰⢸⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⡿⠟⠀⠙⠻⣷⣦⣤⣶⡭⠀⡸⢾⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣀⢥⣖⣀⠀⠀⠸⣿⣿⠿⠁⠀⣽⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣭⣿⣿⣷⣶⣿⠷⠔⠀⠈⢿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⡿⠟⠃⡽⠛⠛⠛⠛⠋⠀⠀⠀⢀⠐⠁⠈⠻⢿⣿⣿⣿⣿⣿ ⠿⠛⠉⠉⠉⠀⠀⠀⠀⠀⠳⣷⣷⠀⠀⠀⢀⡠⠕⠁⠀⠀⠀⠀⠀⠈⠉⠻⠿⢿ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠢⠒⠚⠁⠀

Lobo_23xLobo_23xSep 25, 2026

It doesn't work

Replying to @Lobo_23x
Cat_ScriptCat_ScriptOct 2, 2026

im sorry f3x gun Fixed

More Scripts for Universal Scripts