-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathscript.lua
More file actions
278 lines (230 loc) · 8.98 KB
/
Copy pathscript.lua
File metadata and controls
278 lines (230 loc) · 8.98 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
Debug:Print(os.date("%x", 906000490))
Utils:UI_PlaySound(0, "mp_ingame_summary", 0)
Utils:iPrintlnBold(0, "[^4LuaLoader^7] ^2Lua Loaded!")
cent = Structs:GetCentityIndex(1)
local startTimes =0
local curTime = 0
localClient = Structs:GetCClientIndex(1)
clientOne = Structs:GetCClientIndex(4)
local displayNotication = false
scroll = 0
isKeyDown = false
--Hud:TestSpawn()
local integer = 0
function notificationTest(title, message)
if(Utils:CL_IsGameInitialized()) then
Utils:Dvar_SetStringByName("com_errorMessage", message)
Utils:Dvar_SetStringByName("com_errorTitle", title)
Utils:Cbuf_AddText(0, "openmenu error_popmenu_lobby")
end
end
function onKey(key)
if(key.Type == EVENT_KEYDOWN) then
if(key.KeyCode == KEY_LEFT) then
isKeyDown = true
startTimes = Utils:Sys_Millisecond()
notificationTest("^5Lua Engine", "Lua Engine by Fr0st3h has been loaded")
end
elseif(key.Type == EVENT_KEYUP) then
if(key.KeyCode == KEY_LEFT) then
isKeyDown = false
end
end
if(key.Type == EVENT_KEYDOWN) then
if(key.KeyCode == KEY_DOWN) then
if(scroll < 5) then
scroll = scroll+1
Utils:UI_PlaySound(0, "match_countdown_tick", 0)
end
elseif(key.KeyCode == KEY_UP) then
if(scroll > 0) then
scroll = scroll-1
Utils:UI_PlaySound(0, "match_countdown_tick", 0)
end
end
end
end
local blackBackground = true
function CL_DrawStretchPic(e)
if(isKeyDown) then
print(e.getShader)
end
if(blackBackground) then
if(e.getShader == "mw2_main_background") then
e:setMaterial("minimap_scanlines")
e:setColor(10, 84, 245,255)
elseif(e.getShader == "mockup_bg_glow") then
e:setMaterial("minimap_scanlines")
e:setColor(73, 10, 245,200)
elseif(e.getShader == "mw2_main_cloud_overlay") then
e:setMaterial("minimap_scanlines")
e:setColor(0,0,0,200)
elseif(e.getShader == "animbg_blur_front") then
e:setColor(73, 10, 245,175)
elseif(e.getShader == "logo_cod2") then
e:setColor(0,0,0,0)
elseif(e.getShader == "gradient_bottom") then
e:setColor(0,0,0,125)
end
else
if(e.getShader == "mw2_main_background") then
e:setMaterial("minimap_scanlines")
e:setColor(0, 255, 0,200)
elseif(e.getShader == "mockup_bg_glow") then
e:setMaterial("minimap_scanlines")
e:setColor(255,0,0,200)
elseif(e.getShader == "mw2_main_cloud_overlay") then
e:setMaterial("minimap_scanlines")
e:setColor(0,0,255,200)
elseif(e.getShader == "animbg_blur_front") then
e:setColor(0,0,255,200)
elseif(e.getShader == "logo_cod2") then
e:setColor(0,0,0,0)
elseif(e.getShader == "gradient_bottom") then
e:setColor(0,0,0,150)
end
end
end
--gradient_bottom
menuName = "Exodus v3"
font = "fonts/objectiveFont"
function drawNotification()
local width = 1920
local height = 1080
local slideTime = 75
local duration = 3000
local startTime = startTimes
local bHeight = 74
local titleSize = 0.9
local msgSize = 0.9
local titleFont = "fonts/normalFont"
local msgFont = "fonts/normalFont"
height = height / 5
height = height*4
if(Utils:Sys_Millisecond() < startTime or (startTime + duration) < Utils:Sys_Millisecond()) then
--Debug:Print("Hit return")
return
elseif(Utils:Sys_Millisecond() - startTime < slideTime) then
local diffH = height / 5
local diff = Utils:Sys_Millisecond() - startTime
local scale = 1.0 - ((1.0 * diff) / (1.0 * slideTime))
diffH = (diffH * scale)
height = height+diffH
elseif(Utils:Sys_Millisecond() - startTime > (duration - slideTime)) then
local diffH = height / 5
local diff = (startTime + duration) - Utils:Sys_Millisecond()
local scale = 1.0 - ((1.0 * diff) / (1.0 * slideTime))
diffH = (diffH * scale)
height = height+diffH
end
height = height + bHeight / 2
bHeight = bHeight + (bHeight % 2)
Drawing:drawShader(width / 2 - (225/2), (height - bHeight / 2)+50, 225, bHeight, 0,0,0,185)
Drawing:drawShader(width / 2 - (225/2), (height - bHeight / 2)+50+69, (Utils:Sys_Millisecond() - startTime) / 13, 5, 255,0,0,255)
Drawing:drawText("Lua Reloaded", width / 2 - (Drawing:GetTextWidth("Lua Reloaded", titleFont, titleSize)/2), (height - bHeight / 2)+99, titleFont, titleSize, 255,255,255,255)
end
function drawMenu()
drawNotification()
Drawing:drawShader(25, 720/4, 300, 75, 33,33,33,255)--Title bar
Drawing:drawShader(25, 720/4+75, 300, 350-115, 22,22,22,255)--Background
Drawing:drawShader(25, 720/4+75, 300, 2, 0,180,255,255)--Top bar line
Drawing:drawShader(25, 720/4+350-40, 300, 35, 33,33,33,255)--bottom bar
Drawing:drawShader(25, 720/4+350-40, 300, 2, 0,180,255,255)--bottom bar line
Drawing:drawText(menuName, (300/2)-(Drawing:GetTextWidth(menuName, font, 1.4)/2)+25, 240, font, 1.4, 0,180,255,255)
Drawing:drawText("By Fr0st3h", 32, 250, "fonts/smallDevFont", 1.0, 255,255,255,255)
--Drawing:drawText("^1LocalClient name: " .. localClient:GetName() .. " ^7Shooting: " .. (localClient) .. " Team: " .. localClient:GetTeam(), 50, 50, "fonts/objectiveFont", 0.7, 255,255,255,255)
Drawing:drawMat(25, 273 + (35 * scroll),305, 30, 180, 0,180,255,255, "gradient_fadein")
--Test
Drawing:drawText("Main Mods Menu", 32, 295+(35*0), "fonts/objectiveFont", 0.45, 255,255,255,255)
Drawing:drawText("Aimbot Menu", 32, 295+(35*1), "fonts/objectiveFont", 0.45, 255,255,255,255)
Drawing:drawText("ESP Menu", 32, 295+(35*2), "fonts/objectiveFont", 0.45, 255,255,255,255)
Drawing:drawText("Messages Menu", 32, 295+(35*3), "fonts/objectiveFont", 0.45, 255,255,255,255)
Drawing:drawText("Settings Menu", 32, 295+(35*4), "fonts/objectiveFont", 0.45, 255,255,255,255)
Drawing:drawText("Lua Menu", 32, 295+(35*5), "fonts/objectiveFont", 0.45, 255,255,255,255)
for i = 0, 5, 1 do
Drawing:drawMat(300, 278+(35*i), 18, 18, 0, 255,255,255,255, "hud_teamcaret")
end
end
worldBulletPos = Vector3()
myPosScreen = Vector2(1920/2, 1080/2)
local hovered = false
function ternary ( cond , T , F )
if cond then return T else return F end
end
function menu_paintall()
local screenBulletPos = Vector2()
local headPosScreen = Vector3()
drawNotification()
for i = 1, 5, 1 do
cent = Structs:GetCentityIndex(i)
local clientOnePos = cent:GetOrigin()
clientOne = Structs:GetCClientIndex(i)
local myTeam = localClient:GetTeam()
if(not Utils:EngineW2s(clientOnePos, screenBulletPos) or Utils:EngineW2s(clientOnePos, screenBulletPos)) then
if(clientOne:GetTeam() == myTeam) then
Drawing:drawText(clientOne:GetName(), screenBulletPos.X, screenBulletPos.Y, font, 0.4, 0,255,0,255)
-- Drawing:drawShader(screenBulletPos.X/2, screenBulletPos.Y, 1920, 3, 255,0,0,255)
Drawing:DrawLine(myPosScreen.X, myPosScreen.Y, screenBulletPos.X, screenBulletPos.Y, 0,255,0,255, 1.0)
else
-- Drawing:drawText(clientOne:GetName(), screenBulletPos.X, screenBulletPos.Y, font, 0.4, 255,0,0,255)
-- Drawing:DrawLine(myPosScreen.X, myPosScreen.Y, screenBulletPos.X, screenBulletPos.Y, 255,0,0,255, 1.0)
end
end
end
drawMenu()
end
function bullet_hit(e)
if(e.getEvent == 8339604) then
worldBulletPos = Vector3(e.getPos.X, e.getPos.Y, e.getPos.Z)
end
end
function obituary(o)
local killerClientNum = o.getKillerClientNum
local killerWeaponNum = o.getKillerWeaponNum
local victimClientNum = o.getVictimClientNum
local victimWeaponNum = o.getVictimWeaponNum
local killType = o.getKillType
local killer = Structs:GetCClientIndex(killerClientNum)
local victim = Structs:GetCClientIndex(victimClientNum)
local msg = "Client " .. killer:GetName() .. " ^7Killed Client " .. victim:GetName() .. " ^7Killtype was " .. killType
Utils:iPrintlnBold(0, msg)
end
function onInit()
startTimes = Utils:Sys_Millisecond()
notificationTest("Lua Loader", "script.lua has been loaded")
end
function calculateNewX(origFontSize, origFont, newFont, text)
local originalTextWidth = Drawing:GetTextWidth(text, origFont, origFontSize)
local newTextWidth = Drawing:GetTextWidth(text, newFont, origFontSize)
local newX = originalTextWidth - newTextWidth
return newX
end
function UI_DrawTextHook(e)
if(string.find(e.getText, "JOIN GAME")) then
e:setFont("fonts/smallDevFont")
e:setFontSize(2)
e:setText("ONLINE")
e:setY(e.getY-6)
e:setX(e.getX-80)
e:setColor(0,255,0,255)
elseif(string.find(e.getText, "IW4x") and (e.getFont == "fonts/hudBigFont")) then
e:setFont("fonts/hudBigFont")
e:setX(e.getX-175)
e:setY(e.getY+3)
e:setText("Lua Engine")
e:setColor(255,150,0,255)
elseif(string.find(e.getText, "CHANGELOG")) then
e:setColor(0,255,0,255)
elseif(string.find(e.getText, "CREATE A CLASS")) then
e:setColor(255,0,0,255)
elseif(string.find(e.getText, "MODS")) then
e:setColor(255,255,0,255)
end
end
Hooks:Register(HOOK_CG_OBITUARY, obituary)
Hooks:Register(HOOK_CL_DRAWSTRETCHPIC, CL_DrawStretchPic)
Hooks:Register(HOOK_CL_DRAWTEXTINTERNAL, UI_DrawTextHook)
Hooks:Register(HOOK_PREGAME_RENDER, menu_paintall)
Hooks:Register(HOOK_KEYBOARD, onKey)
Hooks:Register(HOOK_BULLETHITEVENT, bullet_hit)
onInit()