Модератор раздела "Создание скриптов для читов"
-
Автор темы
- #1
code_language.lua:
--@description: yougame.biz
--@author: uwukson4800
local ui = require 'wrapper'
local entity_extended = require 'gamesense/entity'
local slider = ui.create('lol'):slider('delay', 0, 10, 0)
local checkbox = ui.create('lol'):switch('performance mode', false)
local animation_fix do
animation_fix = {}
animation_fix.anim_data = {
delayed_states = {},
last_update = 0,
}
animation_fix.setup_command = function(cmd)
local me = entity.get_local_player()
if not me then return end
local self_index = entity_extended.new(me)
if not self_index:get_anim_state() then return end
local current_time = globals.curtime()
local delayed_state = {
time = current_time,
layers = {}
}
for i = 0, 15 do
local layer = self_index:get_anim_overlay(i)
if layer then
delayed_state.layers[i] = {
cycle = layer.cycle,
weight = layer.weight
}
end
end
table.insert(animation_fix.anim_data.delayed_states, delayed_state)
local max_states = checkbox:get() and 32 or 64
if #animation_fix.anim_data.delayed_states > max_states then
table.remove(animation_fix.anim_data.delayed_states, 1)
end
end
animation_fix.pre_render = function()
local me = entity.get_local_player()
if not me then return end
local self_index = entity_extended.new(me)
if not self_index:get_anim_state() then return end
local current_time = globals.curtime()
local states = animation_fix.anim_data.delayed_states
if #states < 2 then return end
if current_time - animation_fix.anim_data.last_update < slider:get() then
local old_state = states[1]
for i = 0, 15 do
local layer = self_index:get_anim_overlay(i)
if layer and old_state.layers[i] then
layer.cycle = old_state.layers[i].cycle
layer.weight = old_state.layers[i].weight
end
end
else
animation_fix.anim_data.last_update = current_time
end
end
end
client.set_event_callback("setup_command", animation_fix.setup_command)
client.set_event_callback("pre_render", animation_fix.pre_render)