No, you did it right, with
takeItem("Rock Cone",10); that 10 is defining $qty in the function. I wasn't entirely sure on how to construct the end of the function... rather than
PHP Code:
throw new Exception("Sorry, you only have {$owned} {$item}, you need {$qty}!");
Try... either:
PHP Code:
echo "Sorry, you only have {$owned} {$item}, you need {$qty}!";
or maybe just
I'm not totally sure what to do on failure, so I just had it throw an Exception.