Moving player behavior to lua