fixed createobject and added checks to OnWeaponAssignment to prevent scripts from crashing the server