0% found this document useful (0 votes)
4 views3 pages

Message

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Message

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

local Config = {

Visualize = true,
FOV = 75,
Hitchance = 80,
["Multipoint Scaling"] = 100,
Hitboxes = {
Head = true,
Torso = false,
Arms = false,
Legs = false
},
Priority = false,
["%"] = {
Head = 35,
Torso = 50,
Arms = 35,
Legs = 35
},
}

local game = valex.get_game()


local workspace = valex.find_first_child_of_class(game, "Workspace")
local players_folder = valex.find_first_child(workspace, "Players")
local camera = valex.find_first_child_of_class(workspace, "Camera")
local uis = valex.find_first_child_of_class(game, "UserInputService")

local Ind = {}
[Link] = {}
[Link] = 0
Ind.update_tick = 0

local function GetDistSq(x1, y1, x2, y2)


local dx = x1 - x2
local dy = y1 - y2
return dx * dx + dy * dy
end

local function DrawFOV()


if not [Link] then return end
local mouse = valex.get_mouse_location(uis)
local r = [Link]
local seg = 48
local gap = 0.7 + [Link](r * 0.1) * 0.8
local start_a = r
local end_a = r + ([Link] * 1.85 - gap)
local prev_x, prev_y
for i = 0, seg do
local t = i / seg
local a = start_a + (end_a - start_a) * t
local x = mouse.x + [Link](a) * [Link]
local y = mouse.y + [Link](a) * [Link]
if prev_x then
valex.draw_line(prev_x, prev_y, x, y, 0xFFFFFFFF, 1)
end
prev_x, prev_y = x, y
end
[Link] = r + 0.006
end
local function UpdatePlayers()
Ind.update_tick = Ind.update_tick + 1
if Ind.update_tick % 3 ~= 0 then return end

local current = {}
local teams = valex.get_children(players_folder)
for i = 1, #teams do
local team = teams[i]
local chars = valex.get_children(team)
for j = 1, #chars do
local char = chars[j]
local name = valex.get_name(char)
current[name] = true
local data = [Link][name]
local head = valex.find_first_child(char, "Head")
if head then
if not data then
[Link][name] = {Head = head}
end
[Link][name].Pos = valex.get_position(head)
end
end
end
for name in pairs([Link]) do
if not current[name] then
[Link][name] = nil
end
end
end

local function GetGun()


local arms = valex.find_first_child(camera, "Arms")
if arms then return arms end
return valex.find_first_child(camera, "Gun")
end

local function Aimbot()


local mouse = valex.get_mouse_location(uis)
local fov_sq = [Link] * [Link]
local closest_pos = nil
local min_dist_sq = fov_sq
local use_priority = [Link]
local priorities = Config["%"]
for _, data in pairs([Link]) do
local pos = [Link]
local spos = valex.world_to_screen_point(camera, pos)
if [Link] then
local dist_sq = GetDistSq(spos.x, spos.y, mouse.x, mouse.y)
if dist_sq < min_dist_sq then
local valid = true
if use_priority then
local pri = [Link] or 50
if [Link](100) > pri then
valid = false
end
end
if valid then
min_dist_sq = dist_sq
closest_pos = pos
end
end
end
end
local gun = GetGun()
if closest_pos and gun and valex.is_mouse_button_pressed(uis, 1) then
local scaling = Config["Multipoint Scaling"] * 0.01 * 0.5
local rand = [Link]() - 0.5
local target = {
x = closest_pos.x + rand * scaling,
y = closest_pos.y + rand * scaling,
z = closest_pos.z + rand * scaling
}
local miss = ([Link](100) > [Link]) and ([Link]() -
1.5) * 2 or 0
local dx = target.x - [Link].x + miss
local dy = target.y - [Link].y + miss
local dz = target.z - [Link].z + miss
local mag = [Link](dx*dx + dy*dy + dz*dz)
if mag > 0 then
valex.set_property(gun, "LookVector", {x = dx / mag, y = dy / mag, z =
dz / mag})
end
end
end

[Link]("render", DrawFOV)
[Link]("update", UpdatePlayers)
[Link]("update", Aimbot)

You might also like