Desrat 0 Posted August 4, 2013 How would I evaluate if a task already exists? I need to see if it exists so I can remove it if necessary. Ive tried with no success. if (isNull tskobj1) then { // do nothing } else { player removeSimpleTask tskobj1; }; Share this post Link to post Share on other sites
cuel 25 Posted August 4, 2013 (edited) isNil checks if something is defined - remember to wrap it in quotes if (isNil "tskobj1") then Edited August 4, 2013 by cuel Share this post Link to post Share on other sites
kylania 567 Posted August 4, 2013 How are you in a situation where you're unsure which tasks a player has? You create the tasks, how can you not know? :) Share this post Link to post Share on other sites
Desrat 0 Posted August 5, 2013 Mission is random generated but this script repeats every time a new task is created, so if a task already exists I delete it and create a new one, however when the mission starts (or JIP) the client has no mission so it can't be deleted. If I don't check for its existence and code around it a "undefined variable" error occurs. Share this post Link to post Share on other sites