local function handle_player (player, fn) local data = {} data.control = player:get_player_control() data.properties = player:get_properties() data.physics = player:get_physics_override() local result = fn(player, data) player:set_properties(data.properties) player:set_physics_override(data.physics) return result end return { handle_player = handle_player, }