Hind 29 Опубликовано 25 Августа 2022 Привет всем! Решил намутить рабочую гитару, чтобы после 43 секунд игры мелодии, она возвращалась обратно в инвентарь. Забацал 2 файла, один dmb.script, второй dmb2.script. Скрытый текст local tSound ={ dmb_pleer = "interface\\inv_guitar", } function muzika() alife():create("dmb_pleer", db.actor:position(), 1, db.actor:game_vertex_id(), db.actor:id()) end function use_item(obj) local obj = obj:section() if obj then if obj == "dmb_pleer" then dmb2.start_timer() end end if obj and tSound[obj:section()] then local snd = xr_sound.get_safe_sound_object(tSound[obj:section()]) if snd then snd:play_no_feedback(db.actor, sound_object.s2d, 0, vector(), 2.0) end end end А вот второй скрипт, куда я запихнул таймер Скрытый текст function action_timer() alife():create("dmb_pleer", db.actor:position(), 1, db.actor:game_vertex_id(), db.actor:id()) end function start_timer() local iTimer = time_global() + 43000 local function check_timer() return time_global() > iTimer end level.add_call(check_timer, action_timer) end И при попытке юзануть ту самую гитару, вылазит ЭТО: [error]Expression : fatal error [error]Function : CScriptEngine::lua_error [error]File : E:\stalker\sources\trunk\xr_3da\xrGame\script_engine.cpp [error]Line : 73 [error]Description : <no expression> [error]Arguments : LUA error: ....l.k.e.r. Тень Чернобыля\gamedata\scripts\dmb.script:22: attempt to call method 'section' (a nil value) Помогите пожалуйста) Hind Upgrade Mod Поделиться этим сообщением Ссылка на сообщение