local utils = require "nl/utils"
--ready to use.
- v [void]
- t [table]
return [boolean] true|false
local foo = {
a = 1,
b = 2,
}
print(utils:contains(1, foo))
--true
print(utils:contains(3, foo))
--false
- n [number] int 0-1
return [boolean] true|false
print(utils:numbertobool(1))
--true
print(utils:numbertobool(0))
--false
- n [number]
- min [number]
- max [number]
return [number]
print(utils:clamp(5, 0, 4))
--4
- n [number]
- a [number] start
- b [number] end
- m [string] module
return [boolean] true|false
--for example i have client.lua module in my nl folder
print(utils:is_module_loaded("nl/client"))
--true
print(utils:is_module_loaded("nl/client.lua")) -- do not add .lua
--false
print(utils:is_module_loaded("nl/entities")) -- I dont have entities.lua module in the folder
---false
- r [number] int 0 - 255
- g [number] int 0 - 255
- b [number] int 0 - 255
- a [number] int 0 - 255
- ... [string]
utils:printcolor(255, 0, 0, 255, "string")
- entity [userdata]
return [boolean]
- entity [userdata]
return [boolean]
- entity [userdata]
return [boolean]
- enemy_only [boolean] true|false
return [userdata]
print(utils:get_nearest_player(true):GetName())
--Bob
return [table] table of userdatas
local teammates = utils:get_all_teammates()
for _, teammate in pairs(teammates) do
print("userdata = " .. tostring(teammate) .. " name = " .. teammate:GetName())
end
--[[
userdata = userdata: 0x477012d0 name = pred
userdata = userdata: 0x477012f0 name = Grant
userdata = userdata: 0x47701310 name = Duffy
userdata = userdata: 0x2457f130 name = Will
]]
- entity [userdata]
return velocity [number] float
local localplayer = EntityList.GetLocalPlayer()
print(utils:get_velocity(localplayer))
-- 0 <-- standing rn
- entity [userdata]
- hitbox [number] int
return [boolean]
local function draw()
local players = EntityList.GetPlayers()
local localplayer = EntityList.GetLocalPlayer()
for _, v in pairs(players) do
if v == localplayer then
goto skip
end
local head = 0
local playerhbcenter = v:GetHitboxCenter(head)
local hbcenter2d = Render.WorldToScreen(playerhbcenter)
local isvisible = utils:is_shootable(v, head)
local r, g, b = 240, 70, 70
if isvisible then
r, g, b = 70, 240, 70
end
Render.CircleFilled(Vector2.new(hbcenter2d.x, hbcenter2d.y), 8, 20, Color.RGBA(r, g, b, 255))
::skip::
end
end
Cheat.RegisterCallback("draw", draw)
- entity [number]
- tick [number]
return [userdata] vector3
local localplayer = EntityList.GetLocalPlayer()
local position = localplayer:GetProp("m_vecOrigin")
local extrapolated = utils:extrapolate(localplayer, 1)
--position: -45.610904693604 1752.3875732422 1.03125 | extrapolated: -49.103141784668 1753.75390625 1.03125
- path [string]
- volume [number] int 0 - 1
utils:play_sound("buttons/switch_press_arena_02", 1)
- x [number] vector2
- y [number] vector2
- r [number] int 0 - 255 red
- g [number] int 0 - 255 green
- b [number] int 0 - 255 blue
- a [number] int 0 - 255 alpha
- fontsize [number] int font size
- font [userdata] font
- centered [boolean] centered
- ... [string]
local FONT_CALIBRI = Render.InitFont("calibri", 18, {"b"})
local function draw()
utils:draw_text_outline(1000, 500, 255, 255, 255, 255, 18, FONT_CALIBRI, false, "Hello World!")
end
Cheat.RegisterCallback("draw", draw)
Author: invalidcode232
- x [number]
- y [number]
- centered [boolean] true|false
- spacing [number]
- fontsize [number]
- font [userdata]
- data [table]
utils:mutlicolored_text(1000, 1000, true, 3, 18, FONT_CALIBRI, {
{
text = "Hello",
clr = {255, 100, 100, 255}
},
{
text = "World",
clr = {100, 255, 100, 255}
}
})
- instance [void]
- i [number] int
- ct [string] ctype
- instance [void]
- i [number] int
- ct [string] ctype
- i [number] int
- ct [string] ctype