-- https://rscripts.net/@redux -- https://www.roblox.com/games/15253551769/WARMIX-PVP-FPS-Weapon-Battles-Shooter-Gun local melee = { enabled = true, range = 999 -- aka distance } local rs = game:GetService("ReplicatedStorage") local plr = game:GetService("Players") local wrkspc = game:GetService("Workspace") local lp = plr.LocalPlayer local damage = rs:WaitForChild("BlasterKnifeEvent") local function getmelee() if wrkspc:FindFirstChild(lp.Name) then return wrkspc[lp.Name]:FindFirstChild("KnifeStandart") end return nil end local function getDistance(pos1, pos2) return (pos1 - pos2).Magnitude end task.spawn(function() while task.wait(0.2) do if melee.enabled then local humanoid = lp.Character and lp.Character:FindFirstChild("HumanoidRootPart") local knife = getmelee() if humanoid and knife then for _, player in pairs(plr:GetPlayers()) do if player ~= lp and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then local enemy = player.Character.HumanoidRootPart if getDistance(humanoid.Position, enemy.Position) <= melee.range then damage:FireServer("KnifeStandart", player) end end end end end end end)