-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0 Trigger Magnet.lua
35 lines (31 loc) · 1022 Bytes
/
0 Trigger Magnet.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
local ref = gui.Reference("Legitbot", "Triggerbot", "Toggle")
local magnet = gui.Checkbox(ref, "magnet_trg", "Magnet Trigger", false)
magnet:SetDescription("Pulls your crosshair towards the enemy")
local pressed = false
local old_val = {
on_press = gui.GetValue("lbot.aim.fireonpress"),
autofire = gui.GetValue("lbot.aim.autofire")
}
callbacks.Register("Draw", function()
if magnet:GetValue() then
if gui.GetValue("lbot.trg.enable") then
if gui.GetValue("lbot.trg.key") ~= 0 or gui.GetValue("lbot.trg.autofire") then
if gui.GetValue("lbot.trg.autofire") or input.IsButtonDown(gui.GetValue("lbot.trg.key")) then
if pressed == false then
pressed = true
old_val.on_press = gui.GetValue("lbot.aim.fireonpress")
old_val.autofire = gui.GetValue("lbot.aim.autofire")
end
gui.SetValue("lbot.aim.fireonpress", false)
gui.SetValue("lbot.aim.autofire", true)
else
if pressed then
pressed = false
gui.SetValue("lbot.aim.fireonpress", old_val.on_press)
gui.SetValue("lbot.aim.autofire", old_val.autofire)
end
end
end
end
end
end)