Code: Select all
game.player.setcontroller{type=defines.controllers.character}
--Error: attempt to index number value.
Code: Select all
game.player.setcontroller{type=defines.controllers.character}
--Error: attempt to index number value.
Code: Select all
-- let's say you have stored a reference to character entity in characterref
game.player.setcontroller{type=defines.controller.character, character=characterref}
Code: Select all
game.player.connecttocharacter(characterref)