Results 1 to 3 of 3

Thread: Player["White"].steam_name not working if "White" is a string

  1. #1

    Player["White"].steam_name not working if "White" is a string

    The following correctly prints the users name:

    Code:
    print (Player["White"].steam_name)
    However, the following causes an "Error calling Lua function" "cannot access field "White" of userdata<LuaGlobalPlayer>"

    Code:
    	PlayerColourQuote = '"White"'
    	print (Player[PlayerColourQuote].steam_name)
    Using
    Code:
    PlayerColourQuote = '"White"'
    print (PlayerColourQuote)
    shows the string "White" in the chat, so I don't know what I am doing wrong.

  2. #2
    Join Date
    May 2016
    Posts
    1,072
    Incorrect formatting of your string. PlayerColorQuote="White" should do it. Or 'White'.

    The resulting string should be White without any quotes. By having two sets of quotes the resulting string is "White" which is what fails

  3. #3
    Well don't I feel stupid. I thought I had tried that and it didn't work. Thanks!

Similar Threads

  1. [SOLVED] Game Crash: When selecting "single" or "multi-player" mode
    By xV3NOMx in forum Technical Support
    Replies: 14
    Last Post: 08-31-2017, 08:35 PM
  2. Replies: 5
    Last Post: 08-09-2017, 11:32 PM
  3. Replies: 5
    Last Post: 08-09-2017, 11:32 PM
  4. [SOLVED] "/help" command doesn't show green part for "/nick".
    By Mark in forum Bug Reports
    Replies: 1
    Last Post: 09-16-2016, 02:11 PM
  5. Replies: 1
    Last Post: 04-28-2016, 05:48 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
  •