Results 1 to 2 of 2

Thread: setState is not working

  1. #1

    setState is not working

    cubo = getObjectFromGUID("9e83e6")

    print(logString(cubo.getStates()))
    -----------------------------------------------
    1:
    "name": Block Square
    "nickname":
    ...
    "id":1

    2:
    "name": Block Square
    "nickname":
    ...
    "id":2

    3:
    "name": Block Square
    "nickname":
    ...
    "id":3

    4:
    "name": Block Square
    "nickname":
    ...
    "id":4
    -----------------------------------------------
    cubo.setState(2)

    ERROR:
    This state id does not exist


    OBJECT HAVE 5 STATES !! by t way

  2. #2
    Join Date
    Sep 2017
    Posts
    397
    The current state of the object cannot be set. That is, if the object is already in state 2, then obj.setState(2) will cause an error. I cannot tell exactly what is going on here though. I would log(cubo.getStateId()) to see if cubo is already in state 2. I am GUESSING that the current state of an object is not in the state table.

Similar Threads

  1. Help with onObjectRandomize() and setState()
    By Drewkas in forum Scripting
    Replies: 2
    Last Post: 06-03-2020, 02:42 PM
  2. [CRASHES] Mic NOT working in TBT sim
    By Nigan in forum Technical Support
    Replies: 1
    Last Post: 10-11-2019, 02:58 PM
  3. Object.setState() throws error and stops Lua execution
    By Korroz in forum Scripting Bug Reports
    Replies: 3
    Last Post: 01-16-2017, 08:58 PM
  4. Replies: 0
    Last Post: 07-18-2016, 08:45 PM
  5. [SOLVED] SetState is not working [solved]
    By Nightgaunt in forum Scripting
    Replies: 6
    Last Post: 07-16-2016, 10:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •