message (4)
message (4)
Settings = {
Enabled = true,
Key = Enum.KeyCode.Q,
Prediction = 0.147823234,
HitPart = "HumanoidRootPart",
Argument = "UpdateMousePosI",
Resolver = true,
Universal = true, -- New feature to control universal settings
BulletTP = false -- Feature to enable Bullet Teleportation, BTW can you make it
so when I press M it'll do the bullet TP and m again to turn it off
}
Settings = getgenv().Settings
GetClosestToMouse = function()
local Target, Closest = nil, 1 / 0
for _, v in pairs(Players:GetPlayers()) do
if (v.Character and v ~= Client and
v.Character:FindFirstChild("HumanoidRootPart")) then
local Position, OnScreen =
Camera:WorldToScreenPoint(v.Character.HumanoidRootPart.Position)
local Distance = (Vector2.new(Position.X, Position.Y) -
Vector2.new(Mouse.X, Mouse.Y)).Magnitude
UpdateDrawing = function()
local Vector3Pos = Target.Character[Settings.HitPart].Position +
Target.Character[Settings.HitPart].Velocity * Settings.Prediction
local ViewportPos = Camera:WorldToViewportPoint(Vector3Pos)
local MainPos = Vector2.new(ViewportPos.X, ViewportPos.Y)
DotCircle.Position = MainPos
end
local oldpos
local function RecalVel(player, delta)
if player and player.Character and
player.Character:FindFirstChild("HumanoidRootPart") then
local currentPosition = player.Character.HumanoidRootPart.Position
local velocity
if oldpos then
velocity = (currentPosition - oldpos) / delta
oldpos = currentPosition
else
oldpos = currentPosition
end
return velocity
end
end
UserInputService.InputBegan:Connect(function(Input, gameProcessedEvent)
if gameProcessedEvent then return end
RunService.Heartbeat:Connect(function(Delta)
if Target and Target.Character then
if Settings.Resolver then
Target.Character[Settings.HitPart].Velocity = RecalVel(Target, Delta)
end
UpdateDrawing()
else
DotCircle.Position = Vector2.new(9999, 9999)
end
end)
Client.CharacterAdded:Connect(function(newchar)
Character = newchar
CharAdded()
end)
CharAdded()