So my little snippet of code doing this works fine
Code: Select all
local flag = false
function some_func()
flag = true
script.raise_event("my-event", {})
flag = false
end
function other_func()
if not flag then error("This can only be called during my-event") end
-- stuff
end