pasteblox
Explore
Key systems
Docs
Search scripts
⌘K
Sign in
Explore
Key systems
Docs
Discord
New paste
Paste a Luau script and get a page plus a raw link that works with loadstring.
Or let the script's first comment name it.
Empty
/ 512kb
Language
.luau
.lua
Open file
⌘O
Empty
Limit 512kb
Explore
Key systems
Docs
Explore
Key systems
Docs
Sign in
53 lines · 1.8kb
/ 512kb
Language
.luau
.lua
Open file
⌘O
-- // Services \\ local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService") local Players = game:GetService("Players") local Camera = workspace.CurrentCamera local LocalPlayer = Players.LocalPlayer -- // FieldOfView Circle \\ local Circle = Drawing.new("Circle") Circle.Thickness = 1.3 Circle.Radius = 128 Circle.Visible = true Circle.Color = Color3.fromRGB(255, 255, 255) -- // Loop Circle \\ RunService.RenderStepped:Connect(function() local Mouse = UserInputService:GetMouseLocation() Circle.Position = Mouse end) -- // Closest Target in circle \\ local function ClosestInFov() local MousePos = UserInputService:GetMouseLocation() local ClosestPlayer = nil local ClosestDist = math.huge for _, Player in ipairs(Players:GetPlayers()) do if Player == LocalPlayer then continue end local Char = Player.Character if not Char then continue end local Root = Char:FindFirstChild("HumanoidRootPart") if not Root then continue end local ScreenPos, OnScreen = Camera:WorldToViewportPoint(Root.Position) if not OnScreen then continue end local Dist = (Vector2.new(ScreenPos.X, ScreenPos.Y) - MousePos).Magnitude if Dist <= Circle.Radius and Dist < ClosestDist then ClosestDist = Dist ClosestPlayer = Player end end return ClosestPlayer end -- // Hook Shoot Function \\ local BlasterController = require(game:GetService("ReplicatedStorage")["Blaster"]["Scripts"]["BlasterController"]) local OldShoot OldShoot = hookfunction(BlasterController.shoot, function(Self) local Origin = Camera.CFrame.Position local Nearest = ClosestInFov() if Nearest and Nearest.Character and Nearest.Character:FindFirstChild("Head") then local OldCFrame = Camera.CFrame Camera.CFrame = CFrame.new(Origin, Nearest.Character.Head.Position) OldShoot(Self) Camera.CFrame = OldCFrame return end return OldShoot(Self) end)
53 lines · 1.8kb
Limit 512kb