local phem1 = {}
local phem2 = {}
function phem1:get_closest_player()
local phem3 = cloneref(game:GetService('Players'))
local phem4 = cloneref(game:GetService('Workspace'))
local phem5 = cloneref(game:GetService('ReplicatedFirst'))
local phem6 = cloneref(game:GetService('ReplicatedStorage'))
local phem7 = phem3.LocalPlayer
local phem8 = phem4.CurrentCamera
local phem9 = require(game.FindFirstChild(phem5, 'neuron', true))
local phem10 = require(game.FindFirstChild(phem6, 'States', true))
local phem11 = game.GetChildren(game.FindFirstChild(phem4, 'Entities', true))
local phem12 = 9e9
phem1.target = nil
local phem13 = {}
for _, phem14 in phem3:GetPlayers() do
if phem14 == phem7 then continue end
local phem15 = phem9:get_character(phem14)
if phem15 then table.insert(phem13, { char = phem15 }) end
end
for _, phem16 in phem11 do
table.insert(phem13, { char = phem16 })
end
local phem17 = Vector2.new((phem8.ViewportSize.X / 2), (phem8.ViewportSize.Y / 2))
for _, phem18 in phem13 do
local phem19 = phem18.char
if phem10:GetStateValue(phem19, 'Dead', false) then continue end
local phem20 = game.FindFirstChild(phem19, 'HitboxHead')
if not phem20 then continue end
local phem21, phem22 = phem8:WorldToViewportPoint(phem20.Position)
if not phem22 then continue end
local phem23 = (Vector2.new(phem21.X, phem21.Y) - phem17).Magnitude
if phem23 < phem12 then
phem12 = phem23
phem1.target = phem20.Position
end
end
end
local phem24 = cloneref(game:GetService('RunService'))
phem24.PreRender:Connect(function()
phem1:get_closest_player()
end)
local phem25 = false
local phem26 = cloneref(game:GetService('Workspace')).CurrentCamera
local phem27 = cloneref(game:GetService('ReplicatedFirst'))
local phem28 = cloneref(game:GetService('ReplicatedStorage'))
local phem29 = require(game.FindFirstChild(phem27, 'GenerateCommand', true))
local phem30 = require(game.FindFirstChild(phem28, 'CameraHandler', true))
local phem31 = require(game.FindFirstChild(phem28, 'Effects', true))
local phem32
local phem33; phem33 = hookfunction(phem29.GetCameraAngles, newlclosure(function(...)
if not phem30.firstPerson then return phem33(...) end
local phem34 = (phem32 or phem30.currentRotation)
return phem34.X, phem34.Y
end))
local phem35; phem35 = hookfunction(phem31.Identify, newlclosure(function(self, phem36, ...)
local phem37 = (select(4, ...))
if not phem25 and phem1.target and phem36 == 'Shot' and phem37.origin and phem37.hitPos then
phem37.hitPos = (phem37.origin + (phem1.target - phem26.CFrame.p).Unit * (phem37.hitPos - phem37.origin).Magnitude)
end
return phem35(self, phem36, ...)
end))
phem24:BindToRenderStep('', (math.huge - math.huge), function()
if not phem30.firstPerson or not phem1.target then return end
phem32 = phem30.currentRotation
local phem38 = (phem1.target - phem26.CFrame.p).Unit
phem30.currentRotation = vector.create(math.asin(phem38.Y), math.atan2(-phem38.X, -phem38.Z), 0)
end)
phem24:BindToRenderStep('', 101, function()
if phem32 and phem30.firstPerson then
phem30.currentRotation = phem32
phem32 = nil
end
end)
Comments
No comments yet
Be the first to share your thoughts!