Using "Event Commands -> Script" to add an item

For reasons that are tedious and hard to explain...
is there a way to use the script section of the Event commands to add items to the inventory...

Something like:
Spoiler: Code
$gameParty.gainItem($dataItems[1999], $gameVariables.value(1), false)

Which I believed would add an item from the items tab, ID 1999, and add 1 of the item..
but when i check the inventory, nothing was added.
Did you definitely set the value of game variable 1 to 1 before calling the script command?
Sorry to waste anyones time...

Spoiler: This worked
$gameParty.gainItem($dataItems[1999], 1)
Sorry to waste anyones time...

Spoiler: This worked
$gameParty.gainItem($dataItems[1999], 1)
Don't apologize, please!

This just helped me learn and understand at least two more things about scripts!

Thanks for helping a total NOOB!🤘
Glad you solved it, and like @kvngreeley said, do not apologize, this is not stackoverflow 🙂

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/using-event-commands-script-to-add-an-item.144305/