Results 1 to 3 of 3

Thread: Getting the player's colour via scripting

  1. #1

    Getting the player's colour via scripting

    https://steamcommunity.com/sharedfil.../?id=934940946

    This mod by the ever amazing MrStump has code that assigns the colour/name of the person using the tool to a variable rollerColor, however I cannot work out exactly how that variable is discovered.

    function buttonClick_roll(_, rollerColor) presumably uses rollerColor as an input for the function, but I can't work out how rollerColor is actually determined.

    I apologise in advance for the what I presumably assume is an idiot-question.
    Last edited by BaconCatBug; 04-24-2018 at 06:26 AM.

  2. #2
    Join Date
    May 2016
    Posts
    1,072
    When you click a button, it automatically passes 2 parameters. The first is the object the button was attached to (which I did not use, which is why you see an _ for it) and the second is a string of the player color that clicked it.

    Not an idiot-question at all. The new API goes a lot further in explaining it (api.tabletopsimulator.com)

  3. #3
    Ah that makes sense. I'm not using a button so while I can't use this method, thank you for the help!

Similar Threads

  1. Replies: 0
    Last Post: 04-28-2017, 10:14 PM
  2. Replies: 0
    Last Post: 09-24-2016, 05:41 PM
  3. Replies: 1
    Last Post: 09-12-2016, 03:09 PM
  4. [ADDED] Scripting API: Add host property to player
    By Huffel in forum Suggestions
    Replies: 5
    Last Post: 08-07-2016, 02:38 AM
  5. Scripting: Player lift_height
    By dizneyguy in forum Scripting
    Replies: 11
    Last Post: 04-26-2016, 12:53 PM

Posting Permissions

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