Fixed errors when getting entities that did not exist
Same with isKeyPressed
Put misc stuff into tables in the script
Polished script