Auto-translated
Dear users, here is the code:
-- Pyramid
function golemhouse()
StartDialogScene("/DialogScenes/DefiantMage/S1/DialogScene.xdb#xpointer(/DialogScene)");
MessageBox(quest1);
SetObjectiveState("sec1", OBJECTIVE_ACTIVE, p1);
local gems = GetPlayerResource(p1, GEM)
if gremlins >= 1000 and gems >= 100 then
QuestionBox(pyramidpath, "yes", "no");
end
end
Trigger(OBJECT_TOUCH_TRIGGER, golem, "golemhouse")
function yes()
RemoveHeroCreatures(hero, CREATURE_GREMLIN, 1000);
SetPlayerResource(p1, GEM, gems - 100);
end
function no()
print("cancel")
end
How can I make it so that when interacting with the object, the cut-scene and message are displayed only once, while the check for fulfilling the requirements is continuous?