Any ideas what is wrong?
I added this code
Code: Select all
if(GetObjProperty(thing, "objtype") == 0x10)
DestroyItem(thing);
var watt := CreateItemAtLocation(thing.x, thing.y, thing.z, 0x5abc, 1);
endifCode: Select all
function demolish(house)
var lists := GetObjProperty(house, "footage");
var itemlist := {};
foreach entry in lists
foreach thing in ListObjectsInBox(entry[1], entry[2], entry[3], entry[4], entry[5],entry[6])
itemlist.append(thing);
endforeach
endforeach
var chk;
var builtdeed := GetObjProperty(house, "builtdeed");
if(builtdeed)
if(!DestroyItem(SystemFindObjectBySerial(builtdeed)))
DestroyItem(SystemFindObjectBySerial(builtdeed, 1));
endif
endif
foreach thing in itemlist
if(GetObjProperty(thing, "objtype") == 0x10)
DestroyItem(thing);
var watt := CreateItemAtLocation(thing.x, thing.y, thing.z, 0x5abc, 1);
endif
if(GetObjProperty(thing, "houseserial") == house.serial)
if ((GetObjProperty(thing, "secure") == 1) && (thing.movable == 0))
EraseObjProperty(thing, "secure");
if(GetObjProperty(thing, "houseserial" ) == house.serial)
var oldscript := GetObjProperty(thing, "oldscript");
if (oldscript == error)
oldscript := "";
endif
thing.usescript := oldscript;
thing.movable := 1;
EraseObjProperty(thing, "houseserial" );
EraseObjProperty(thing, "oldscript" );
endif
elseif ((GetObjProperty(thing, "lockeddown" ) == 1) && (thing.movable == 0))
thing.movable := 1;
EraseObjProperty(thing, "houseserial");
EraseObjProperty(thing, "lockeddown");
elseif (thing.movable == 0)
if(thing.objtype == 0xa390)
MoveItemToLocation(thing, thing.x, thing.y, (thing.z - 7), MOVEITEM_FORCELOCATION);
else
DestroyItem(thing);
endif
endif
endif
endforeach
DestroyMulti(house );
return;
endfunction