Skip to content

Scripts for beginners.

User Avatar
#434
Auto-translated
Of course, you want to know "what to press to make everything work," but please show some respect to those who are helping you. Manuals are written precisely so that we don't have to explain the same thing to every new script writer. And yes, simple tasks like "simply displaying a message" can evolve into increasingly larger specifications.

And Jack_of_shadows has already written everything you need; you're just too lazy to figure it out. Here's an example:
function MyMobHandler(hero, obj)
if hero == "hero name" then -- So that the script only works for the main hero. If it should work for everyone, remove this
MessageBox("Path/To/Text/file.txt", "MyMobHandlerCallback('"..obj.."')")
end
end

function MyMobHandlerCallback(obj)
Trigger(OBJECT_TOUCH_TRIGGER, obj, nil)
RemoveObject(obj)
-- CreateDwelling("dwell", TOWN_HEAVEN, 3, PLAYER_1 115, 115, GROUND)
-- You can't create an arbitrary building with a script, only a dwelling
end

SetObjectEnabled("MobName", nil)
Trigger(OBJECT_TOUCH_TRIGGER, 'MobName', 'MyMobHandler')
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________