Exunys / Aimbot-V2

ROBLOX Script - Universal Aimbot Script Remake
Creative Commons Zero v1.0 Universal
54 stars 66 forks source link

Is there a way to do math.random between doing headshots and lower body shots? #12

Closed steven2024 closed 1 year ago

steven2024 commented 1 year ago

I would like to have it have a chance of doing headshots but not all the time because it could be suspicious if the game shows headshots to other players.

Exunys commented 1 year ago

Yes, of course. I won't be updating & adding that feature so I will walk you through in how to make such thing:

First of all, you need the Raw Main.lua. Next you should navigate towards lines where the locking position gets calculated like:

Third Person

local Vector = Camera:WorldToViewportPoint(Environment.Locked.Character[Environment.Settings.LockPart].Position)
mousemoverel((Vector.X - UserInputService:GetMouseLocation().X) * Environment.Settings.ThirdPersonSensitivity, (Vector.Y - UserInputService:GetMouseLocation().Y) * Environment.Settings.ThirdPersonSensitivity)

First Person (Animated)

Animation = TweenService:Create(Camera, TweenInfo.new(Environment.Settings.Sensitivity, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {CFrame = CFrame.new(Camera.CFrame.Position, Environment.Locked.Character[Environment.Settings.LockPart].Position)})
Animation:Play()

First Person

Camera.CFrame = CFrame.new(Camera.CFrame.Position, Environment.Locked.Character[Environment.Settings.LockPart].Position)

First, you should add a configurable setting in the environment getgenv().Aimbot for example: RandomizeLockPart. Above the lines provided above, you should add a function that randomizes the lock part but later reverts it

local OldLockPart = Environment.Settings.LockPart

if Environment.Settings.RandomizeLockPart then
   Environment.Settings.LockPart = math.random(1, 2) == 1 and "Head" or "HumanoidRootPart"
end

Camera.CFrame = CFrame.new(Camera.CFrame.Position, Environment.Locked.Character[Environment.Settings.LockPart].Position) -- MAIN CODE / CHANGE WITH THE LINE YOU NEED

Environment.Settings.LockPart = OldLockPart

That should be it, this is just an example to help you create your own, I never tested anything so don't immediately reuse the code entirely. However, this is how it should look like and I hope I was of help and you learned something.