kocrachon 2 Posted May 30, 2015 (edited) Hello All, I am trying to create either a trigger or script, that if a type of item is close enough, it will get deleted. Specifically, I am trying to make it so if I drag "ACE_bodyBagObject" of which there are 5, to a vehicle named "RecoveryVeh", I want it to delete the body bag (to simulate it being put into the recovery truck). Anyone able to assist with this? I tried if ((distance <= 7 and (typeOf ACE_bodyBagObject)) in a trigger, but I just get various errors, so I assume I am on a very bad path to start. Edited May 30, 2015 by Kocrachon Share this post Link to post Share on other sites
killzone_kid 1326 Posted May 30, 2015 You bet. The good way to start would be with learning about commands you want to use and their syntax: https://community.bistudio.com/wiki/distance https://community.bistudio.com/wiki/typeOf https://community.bistudio.com/wiki/if https://community.bistudio.com/wiki/and https://community.bistudio.com/wiki/Mission_Editor:_Triggers Share this post Link to post Share on other sites
kocrachon 2 Posted May 30, 2015 I think my biggest issue is syntax. I use this in the "condition" field (distance <= 7) and (typeOf ACE_bodyBagObject) But it tells me and: Type String, expected Book,code But that doesnt seem to make sense to me. I feel like I am using "and" in the appropriate way... Share this post Link to post Share on other sites
Senshi 10 Posted May 31, 2015 If you'd read the actual script error (-showscripterrors or check your log), you'll see that your typeof condition is not a true test. Look up what "typeof" returns, it's in the link KK gave you (look for the "return value"). It's not a boolean. A condition always must return a boolean. So either modify it so it can actually work (e.g. typeOf bodybag == "Whatever") or use something that actually fits your use case, such as https://community.bistudio.com/wiki/isKindOf Share this post Link to post Share on other sites