-- 1. Элементы меню (Вкладка MISC -> подраздел User)
-- Все названия переведены на английский, чтобы Скит не ругался на аргументы
local main_switch = ui.new_checkbox("MISC", "User", "Enable Pack")
-- Настройки Моделей
local model_switch = ui.new_checkbox("MISC", "User", "Enable Model Changer")
local model_side = ui.new_combobox("MISC", "User", "Select Agent", {"Sir Bloody Darryl", "Number K", "Special Agent Ava"})
-- Настройки Хитсаундов
local hit_switch = ui.new_checkbox("MISC", "User", "Enable Hit Sound")
local hit_sound_type = ui.new_combobox("MISC", "User", "Select Sound", {"Skeet", "Neverlose", "Bell", "Metallic"})
-- Точные пути к оригинальным MDL файлам в CS:GO
local models_list = {
["Sir Bloody Darryl"] = "models/player/custom_player/legacy/tm_professional_varf.mdl",
["Number K"] = "models/player/custom_player/legacy/tm_professional_varg.mdl",
["Special Agent Ava"] = "models/player/custom_player/legacy/ctm_fbi_variantb.mdl"
}
-- 2. Безопасный прекэш моделей (чтобы игра не вылетала при загрузке)
client.set_event_callback("level_init", function()
for _, path in pairs(models_list) do
client.get_model_index(path)
end
end)
-- 3. Логика Хитсаунда
client.set_event_callback("player_hurt", function(event)
if not ui.get(main_switch) or not ui.get(hit_switch) then return end
local attacker = client.userid_to_entindex(event.attacker)
local local_player = entity.get_local_player()
if attacker == local_player then
local sound = ui.get(hit_sound_type)
if sound == "Skeet" then
client.delay_sound(0, "buttons/arena_switch_press_02.wav")
elseif sound == "Neverlose" then
client.delay_sound(0, "physics/metal/paintcan_impact_hard3.wav")
elseif sound == "Bell" then
client.delay_sound(0, "training/bell_impact.wav")
elseif sound == "Metallic" then
client.delay_sound(0, "physics/metal/metal_solid_impact_bullet2.wav")
end
end
end)
-- 4. Логика Модель Чейнджера
client.set_event_callback("net_update_end", function()
if not ui.get(main_switch) or not ui.get(model_switch) then return end
local local_player = entity.get_local_player()
if not local_player or not entity.is_alive(local_player) then return end
local chosen_name = ui.get(model_side)
local model_path = models_list[chosen_name]
if model_path then
local m_index = client.get_model_index(model_path)
-- Если индекс найден, принудительно меняем модельку игрока
if m_index and m_index ~= -1 then
entity.set_prop(local_player, "m_nModelIndex", m_index)
end
end
end)
client.log("[Skeet] Script successfully loaded!")