- Статус
- Оффлайн
- Регистрация
- 13 Июн 2020
- Сообщения
- 160
- Реакции
- -40
Не паста скрипта никсера на гс, а полностью новый скрипт
lua:
local ui_get_icon = ui.get_icon
ui.get_icon = function(input)
local icon = ui_get_icon(input)
if not icon or icon == '' then icon = input end
return '\a' .. ui.get_style('Link Active'):to_hex() .. icon .. ' \aDEFAULT'
end
ui.sidebar('Swastika', '卐')
local function bool2int(boolean)
return boolean and 1 or 0
end
local nl = {
crosshair = ui.find('Visuals', 'World', 'World ESP', 'Crosshair'),
scope_overlay = ui.find('Visuals', 'World', 'Main', 'Override Zoom', 'Scope Overlay'),
}
local tabs = {
main = ui.create('Main', 'Main'),
color = ui.create('Main', 'Color')
}
local menu = {
master = tabs.main:switch(ui.get_icon('plug-circle-check') .. 'Master', false),
mirror = tabs.main:switch(ui.get_icon('arrows-left-right-to-line') .. 'Mirror Swastika', false),
size = tabs.main:slider(ui.get_icon('up-right-and-down-left-from-center') .. 'Size', 1, 20, 10, 10, '%'),
rotation_speed = tabs.main:slider(ui.get_icon('arrows-rotate') .. 'Rotation Speed', -21, 21, 10, 10, function(raw)
if raw == 0 then
return 'Off'
elseif raw == -21 then
return '-Fan'
elseif raw == 21 then
return 'Fan'
end
return raw * 10 .. '%' end
),
rotation_type = tabs.main:combo(ui.get_icon('arrows-spin') .. 'Rotation Style', { 'Classic', 'Narkoman Pavlik', 'Narkoman Pavlik v2' }),
transparency = tabs.main:selectable(ui.get_icon('eye-low-vision') .. 'Transparency', { 'On Grenade', 'In Score (TAB)' }),
color = {
type = tabs.color:combo(ui.get_icon('swatchbook') .. 'Type', {'Static', 'LGBTQ+'}),
color = tabs.color:color_picker(ui.get_icon('palette') .. 'Color', ui.get_style('Link Active')),
},
}
menu.mirror:set_callback(function()
local master = menu.mirror:get()
ui.sidebar('Swastika', master and '卍' or '卐')
end, true)
local function create_color_parameters()
local h, s, v = menu.color.color:get():to_hsv()
local alpha = menu.color.color:get().a
menu.color.gamma = tabs.color:slider(ui.get_icon('circle-half-stroke') .. 'Gamma', 25, 255, s * 255, 1)
menu.color.brightness = tabs.color:slider(ui.get_icon('keyboard-brightness') .. 'Brightness', 25, 255, v * 255, 1)
menu.color.alpha = tabs.color:slider(ui.get_icon('eye-low-vision') .. 'Alpha', 1, 10, alpha / 25, 10, '%')
menu.color.speed = tabs.color:slider(ui.get_icon('arrows-rotate') .. 'Color Shift Speed', 1, 20, 10, 10, '%')
end
create_color_parameters()
local visibility = {}
visibility.main = function()
local master = menu.master:get()
menu.mirror:visibility(master)
menu.size:visibility(master)
menu.rotation_speed:visibility(master)
menu.rotation_type:visibility(master)
menu.transparency:visibility(master)
end
visibility.main()
visibility.color = function()
local master = menu.master:get()
local isStatic = menu.color.type:get() == 'Static'
local isRainbow = menu.color.type:get() == 'LGBTQ+'
menu.color.type:visibility(master)
menu.color.color:visibility(master and isStatic)
menu.color.gamma:visibility(master and isRainbow)
menu.color.brightness:visibility(master and isRainbow)
menu.color.alpha:visibility(master and isRainbow)
menu.color.speed:visibility(master and isRainbow)
end
visibility.color()
menu.master:set_callback(function()
visibility.main()
visibility.color()
local master = menu.master:get()
cvar.crosshair:int(bool2int(not master), true)
end, true)
menu.color.type:set_callback(visibility.color)
math.lerp = function(a, b, t)
return a + (b - a) * t
end
local weapon_types = {
['Sniper'] = 5,
['Grenade'] = 9,
}
local function isSniper(player_entity)
local current_weapon = player_entity:get_player_weapon()
if not current_weapon then return false end
local weapon_info = current_weapon:get_weapon_info()
if not weapon_info then return false end
return current_weapon:get_weapon_info().weapon_type == weapon_types['Sniper']
end
local function isGrenade(player_entity)
local current_weapon = player_entity:get_player_weapon()
if not current_weapon then return false end
local weapon_info = current_weapon:get_weapon_info()
if not weapon_info then return false end
return current_weapon:get_weapon_info().weapon_type == weapon_types['Grenade']
end
local get_rainbow = function(original_color)
original_color = original_color or color(255, 0, 0)
local h, s, v = original_color:to_hsv()
s = menu.color.gamma:get() / 255
v = menu.color.brightness:get() / 255
local speed_modifier = menu.color.speed:get() / 10
h = ((globals.tickcount * speed_modifier) % 360) / 360
return color():as_hsv(h, s, v, 1)
end
local get_rotation = function()
local speed = 100 * (menu.rotation_speed:get() / 10)
local fan_speed = 1000
if menu.rotation_speed:get() == -21 then
speed = -fan_speed
elseif menu.rotation_speed:get() == 21 then
speed = fan_speed
end
if menu.mirror:get() then
speed = -speed
end
local time = globals.curtime
local rotation = time * speed
return rotation
end
local function draw_swastika(position, size, alpha)
size = size * (menu.size:get() / 10)
local gamma = math.atan(size / size)
local rotation_degree = get_rotation()
local gamma_deg = math.deg(gamma)
local cos_gamma = math.cos(gamma)
local a_over_cos_gamma = size / cos_gamma
local reverse_direction = menu.mirror:get()
for i = 1, 4 do
local direction_multiplier = reverse_direction and 1 or -1
local base_angle_rad = math.rad(direction_multiplier * (rotation_degree + (i * 90)))
local gamma_offset_rad = math.rad(direction_multiplier * (rotation_degree + (i * 90) + gamma_deg))
if menu.rotation_type:get() == 'Narkoman Pavlik' then
base_angle_rad = math.rad(direction_multiplier * (0 + (i * 90)))
gamma_offset_rad = math.rad(direction_multiplier * (0 + (i * 90) + gamma_deg))
end
local arm1 = vector(
-(size * math.sin(base_angle_rad)),
-(size * math.cos(base_angle_rad))
)
local arm2 = vector(
-(a_over_cos_gamma * math.sin(gamma_offset_rad)),
-(a_over_cos_gamma * math.cos(gamma_offset_rad))
)
local clr = menu.color.color:get()
if menu.color.type:get() == 'LGBTQ+' then
clr = get_rainbow(menu.color.color:get())
end
clr.a = clr.a * alpha
if menu.rotation_type:get() ~= 'Classic' then
render.push_rotation(rotation_degree)
end
render.line(
position,
position + arm1,
clr
)
render.line(
position + arm1,
position + arm2,
clr
)
if menu.rotation_type:get() ~= 'Classic' then
render.pop_rotation()
end
end
end
local screen = {
size = render.screen_size(),
center = render.screen_size() / 2,
}
local alpha = menu.color.alpha:get() / 10
local in_score = false
local game_phases = {
['HalfTime'] = 4,
['EndGame'] = 5
}
events.render:set(function()
if not menu.master:get() then return end
local me = entity.get_local_player()
if not me or not me:is_alive() then return end
local menu_alpha = menu.color.alpha:get() / 10
alpha = math.lerp(alpha, menu_alpha, 0.05)
local game_rules = entity.get_game_rules()
if not game_rules then return end
local should_hide =
(menu.transparency:get('In Score (TAB)') and in_score) or
(isSniper(me) and not (nl.scope_overlay:get() == 'Remove All' or nl.scope_overlay:get_override() == 'Remove All') and me.m_bIsScoped) or
(not isSniper(me) and me.m_bIsScoped) or
(not nl.crosshair:get('Sniper') and isSniper(me)) or
(game_rules.m_gamePhase == game_phases['HalfTime'] or game_rules.m_gamePhase == game_phases['EndGame'])
if should_hide then
alpha = 0
elseif menu.transparency:get('On Grenade') and isGrenade(me) then
alpha = menu_alpha * 0.25
end
draw_swastika(screen.center, 9 * (screen.size.y / 1080), alpha)
end)
events.createmove:set(function(cmd)
in_score = cmd.in_score
end)
events.shutdown:set(function()
cvar.crosshair:int(1)
end)