Does the issue occur in the editor or during gameplay? If it occurs during gameplay, please specify which movement system is being used (free movement or grid movement):
Gameplay. Both
Briefly describe the issue you're experiencing:
The player.get_item_count() function works if you test with the ingame console, but if you place the commands into a script file and run the file, it errors instead. (see error image)
Are there any errors in the in-game debug console or external console window?

Provide the steps necessary to reproduce the issue:
- Give player an item in game
- in console, type
$var = player.get_item_count(ID); print($var);
and you'll get the count
- Place those two commands into a script resource file
- run it in game..it will error instead