Shoot People Off A Map Simulator Script | SILENT AIMBOT

-- Keybind = X -- Made by mxkxkks -- Add me on Roblox @mxkxkks local UserInputService = game:GetService("UserInputService") local Players = game:GetService("Players") local function findClosestPlayer() local closestPlayer = nil local shortestDistance = math.huge local myPosition = Players.LocalPlayer.Character.HumanoidRootPart.Position for _, player in pairs(Players:GetPlayers()) do if player ~= Players.LocalPlayer then local character = player.Character if character and character:FindFirstChild("HumanoidRootPart") then local targetPosition = character.HumanoidRootPart.Position local distance = (targetPosition - myPosition).Magnitude if distance < shortestDistance then closestPlayer = player shortestDistance = distance end end end end return closestPlayer end local function fireShotgunAtPlayer(player) local myPosition = Players.LocalPlayer.Character.HumanoidRootPart.Position local targetPosition = player.Character.HumanoidRootPart.Position local rayDirection = (targetPosition - myPosition).Unit local ray = Ray.new(myPosition, rayDirection) local shotgunRemoteBridge = Players.LocalPlayer.Character.Shotgun.RemoteBridge shotgunRemoteBridge:FireServer(ray) end UserInputService.InputBegan:Connect(function(input, gameProcessedEvent) if not gameProcessedEvent and input.KeyCode == Enum.KeyCode.X then local closestPlayer = findClosestPlayer() if closestPlayer then fireShotgunAtPlayer(closestPlayer) end end end)
views: 90
2023-08-27 01:05:40
Create free pastes just like this one and get paid. Create paste
×