Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- 🔧 Controller Silent Aim + Rainbow ESP Test (Executor Version)
- ▶ Press DPadRight → Select closest player to cursor
- ▶ That player gets a rainbow outline (only you see it)
- ▶ When you equip and shoot your gun, bullets silently aim at them
- ▶ No red visual bullet appears
- --]]
- local Players = game:GetService("Players")
- local Camera = workspace.CurrentCamera
- local UIS = game:GetService("UserInputService")
- local LP = Players.LocalPlayer
- _G.SelectedTarget = nil
- -- 🔍 Get closest player to cursor
- local function GetClosestPlayer()
- local mouse = LP:GetMouse()
- local closest = nil
- local shortestDist = math.huge
- for _, player in ipairs(Players:GetPlayers()) do
- if player ~= LP and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
- local screenPos, onScreen = Camera:WorldToViewportPoint(player.Character.HumanoidRootPart.Position)
- if onScreen then
- local dist = (Vector2.new(screenPos.X, screenPos.Y) - Vector2.new(mouse.X, mouse.Y)).Magnitude
- if dist < shortestDist then
- shortestDist = dist
- closest = player
- end
- end
- end
- end
- return closest
- end
- -- 🌈 Apply rainbow highlight to selected target
- local function ApplyRainbowHighlight(player)
- local existing = player.Character:FindFirstChild("TargetESP")
- if existing then existing:Destroy() end
- local h = Instance.new("Highlight")
- h.Name = "TargetESP"
- h.Adornee = player.Character
- h.FillTransparency = 1
- h.OutlineTransparency = 0
- h.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
- h.Parent = player.Character
- task.spawn(function()
- local hue = 0
- while _G.SelectedTarget == player and h.Parent do
- hue = (hue + 0.01) % 1
- h.OutlineColor = Color3.fromHSV(hue, 1, 1)
- task.wait(0.05)
- end
- h:Destroy()
- end)
- end
- -- 🎮 DPadRight input to select target
- UIS.InputBegan:Connect(function(input, gpe)
- if gpe then return end
- if input.KeyCode == Enum.KeyCode.DPadRight then
- local target = GetClosestPlayer()
- if target then
- _G.SelectedTarget = target
- ApplyRainbowHighlight(target)
- end
- end
- end)
- -- 🔫 Setup silent aim when gun is fired
- local function GetEquippedToolWithMuzzle()
- local char = LP.Character
- if not char then return nil end
- for _, item in ipairs(char:GetChildren()) do
- if item:IsA("Tool") and item:FindFirstChild("Muzzle") then
- return item
- end
- end
- return nil
- end
- local function SetupSilentAim()
- local tool = GetEquippedToolWithMuzzle()
- if not tool then return end
- local muzzle = tool:FindFirstChild("Muzzle")
- if not muzzle then return end
- tool.Activated:Connect(function()
- if not _G.SelectedTarget then return end
- local hrp = _G.SelectedTarget.Character and _G.SelectedTarget.Character:FindFirstChild("HumanoidRootPart")
- if not hrp then return end
- local origin = muzzle.Position
- local direction = (hrp.Position - origin).Unit
- local ray = Ray.new(origin, direction * 1000)
- local hitPart, hitPos = workspace:FindPartOnRay(ray, LP.Character)
- -- Simulate silent hit (you can hook remote events here)
- if hitPart then
- print("Silent Aim Hit:", hitPart.Name, "at", hitPos)
- else
- print("Silent Aim Missed.")
- end
- end)
- end
- -- 🔄 Hook tool equip
- LP.CharacterAdded:Connect(function(char)
- char.ChildAdded:Connect(function(obj)
- if obj:IsA("Tool") and obj:FindFirstChild("Muzzle") then
- task.wait(0.2)
- SetupSilentAim()
- end
- end)
- end)
- -- ▶ Set up if tool is already equipped
- task.wait(1)
- SetupSilentAim()
Advertisement
Add Comment
Please, Sign In to add comment