Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game.Players
- local LocalPlayer = Players.LocalPlayer
- local GetPlayers = Players.GetPlayers
- local Camera = workspace.CurrentCamera
- local WTSP = Camera.WorldToScreenPoint
- local FindFirstChild = game.FindFirstChild
- local Vector2_new = Vector2.new
- local Mouse = LocalPlayer.GetMouse(LocalPlayer)
- function ClosestChar()
- local Max, Close = math.huge
- for I,V in pairs(GetPlayers(Players)) do
- if V ~= LocalPlayer and V.Team ~= LocalPlayer.Team and V.Character then
- local Torso = FindFirstChild(V.Character, "Torso")
- if Torso then
- local Pos, OnScreen = WTSP(Camera, Torso.Position)
- if OnScreen then
- local Dist = (Vector2_new(Pos.X, Pos.Y) - Vector2_new(Mouse.X, Mouse.Y)).Magnitude
- if Dist < Max then
- Max = Dist
- Close = V.Character
- end
- end
- end
- end
- end
- return Close
- end
- local MT = getrawmetatable(game)
- local __namecall = MT.__namecall
- setreadonly(MT, false)
- MT.__namecall = newcclosure(function(self, ...)
- local Method = getnamecallmethod()
- if Method == "FindPartOnRay" and not checkcaller() and tostring(getfenv(0).script) == "GunInterface" then
- local Character = ClosestChar()
- if Character then
- return Character.Torso, Character.Torso.Position
- end
- end
- return __namecall(self, ...)
- end)
- setreadonly(MT, true)
- local vu = game:GetService("VirtualUser")
- game:GetService("Players").LocalPlayer.Idled:connect(function()
- vu:Button2Down(Vector2.new(0,0),workspace.CurrentCamera.CFrame)
- wait(1)
- vu:Button2Up(Vector2.new(0,0),workspace.CurrentCamera.CFrame)
- end)
- game.StarterGui:SetCore("SendNotification", {
- Title = "Subscribe To AlexScripterUnfounded";
- Text = "Made by RiotScripterX"; -- what the text says (ofc)
- Duration = 20;
- })
- wait(1)
- game.StarterGui:SetCore("SendNotification", {
- Title = "Yeah Boy";
- Text = "Enjoy"; -- what the text says (ofc)
- Duration = 20;
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement