-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0 Long Jump.lua
63 lines (51 loc) · 1.96 KB
/
0 Long Jump.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
local main_font = draw.CreateFont("Verdana", 26);
local combo = gui.Combobox(gui.Reference( "MISC","Movement", "Jump"), 'msc_edgejump_vars','Long Jump Type','Normal', 'LJ Bind -forward', 'LJ Bind -back', 'LJ Bind -moveleft', 'LJ Bind -moveright')
local ljbind = gui.Checkbox(gui.Reference( "MISC","Movement", "Jump"), "lj_bind", "LJ Bind Edge Jump", true);
ljbind:SetDescription("Allows you to jump further with one unit extra height.")
local ui_checkbox = gui.Checkbox(gui.Reference( "Visuals", "Other", "Extra"), "lj_bind_status", "LJ Bind Status", false);
local edgejump = gui.GetValue("misc.edgejump");
callbacks.Register("CreateMove", function(cmd)
if (ljbind:GetValue() ~= true) then
return
end
local flags = entities.GetLocalPlayer():GetPropInt("m_fFlags")
if flags == nil then return end
local onground = bit.band(flags, 1) ~= 0
if (not onground and input.IsButtonDown(edgejump)) then
cmd:SetButtons( 86 )
if (combo:GetValue() == 0) then
return;
end
if (combo:GetValue() == 1) then
client.Command("-forward", true)
end
if (combo:GetValue() == 2) then
client.Command("-back", true)
end
if (combo:GetValue() == 3) then
client.Command("-moveright", true)
end
if (combo:GetValue() == 4) then
client.Command("-moveleft", true)
end
return
end
end)
callbacks.Register("Draw", function()
local x, y = draw.GetScreenSize( )
local centerX = x / 2
local lp = entities.GetLocalPlayer(); -- Get our local entity and check if its `nil`, If it's nil lets abort from here
local flags = entities.GetLocalPlayer():GetPropInt("m_fFlags")
if flags == nil then return end
local onground = bit.band(flags, 1) ~= 0
draw.SetFont(main_font)
if edgejump ~= 0 and input.IsButtonDown(edgejump) then
draw.Color(255, 255, 255, 255)
draw.Text( centerX , y - 150, "lj")
end
if (onground) then return end
if edgejump ~= 0 and input.IsButtonDown(edgejump) then
draw.Color(30, 255, 109)
draw.Text( centerX , y - 150, "lj")
end
end)