right now im doing some custom scripting for my housing system in game, and ive got a function that recognizes "i wish to place a trash barrel" and locks it down, and i want a function that recognizes the speech "i wish to destroy a trash barrel".
i created the script a couple days ago, and its compiles fine and what not. the problem is destroying the actual item, here is the script:
Code: Select all
function DestroyTrashBarrel(parms)
var sign := parms[1];
var owner := parms[2];
var trashbarrel := 0x17057;
var homeinfo := GetObjProperty (sign, "homeinfo");
if (!homeinfo)
return;
endif
if (IsInsidetheHouse(owner, sign));
var targ := Target(owner);
if (targ)
if (targ.item == trashbarrel)
SendSysMessage(owner, "passed the second if.", font := _DEFAULT_TEXT_FONT, color := MESSAGE_COLOR_MESSAGE);
DestroyItem(item);
else
SendSysMessage(owner, "You can only destroy trash barrels...", font := _DEFAULT_TEXT_FONT, color := MESSAGE_COLOR_MESSAGE);
endif
elseif (!targ)
SendSysMessage(owner, "Canceled.", font := _DEFAULT_TEXT_FONT, color := MESSAGE_COLOR_MESSAGE);
return;
endif
elseif (!IsInsidetheHouse(owner, sign));
SendSysMessage(owner, "You must be inside your home to use this command!", font := _DEFAULT_TEXT_FONT, color := MESSAGE_COLOR_MESSAGE);
return;
endif
endfunction
thanks in advance, mat