moved out lua from script entity