Page 1 of 1
defines.controllers
Posted: Mon Sep 16, 2013 12:44 pm
by rk84
How do I change controller from god/ghost to character?
Code: Select all
game.player.setcontroller{type=defines.controllers.character}
--Error: attempt to index number value.
Re: defines.controllers
Posted: Mon Sep 16, 2013 9:53 pm
by slpwnd
The syntax is:
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}
However this doesn't work in 0.6.4 because of a small bug. It will be fixed for 0.7. In the meantime you can use:
Code: Select all
game.player.connecttocharacter(characterref)
Re: defines.controllers
Posted: Mon Sep 16, 2013 10:21 pm
by rk84
Thank you