Rewrite player.lua