Page 1 of 1

[1.1.0/1.1.1] LuaGuiElement::text doesnt accept numbers

Posted: Thu Nov 26, 2020 12:06 pm
by LuziferSenpai
Hey,

if you run these two commands:

Code: Select all

/c game.player.gui.screen.add{type = "textfield", name = "test", text = 1}

Code: Select all

/c game.player.gui.screen.test.text = 5
You get the error:
Cannot execute command. Error: (command): 1: bad argument #1 of 2 '__newindex' (string expected, got number)
But whats funny is, that when creating the element it accepts a number.

Greetz,

Luzifer

Re: [1.1.0/1.1.1] LuaGuiElement::text doesnt accept numbers

Posted: Thu Nov 26, 2020 12:13 pm
by Klonan
Rseding changed it so you have to be explicit, use tostring() on the number