So here is some context i tried to test it and this error popped up
ERROR!!! :: ############################################################################################
ERROR in
action number 1
of Other Event: Room Start
for object world:
global variable name '_flag' index (100447) not set before reading it.
at gml_Script_Flag_Set (line 9) - var map=global._flag;
############################################################################################
gml_Script_Flag_Set (line 9)
gml_Object_world_Other_4 (line 1) - Flag_Set(FLAG_TYPE.STATIC,FLAG_STATIC.ROOM,room);