|
| 11 Jun 2015 06:11 PM |
print 'Hello world!' cow = script.Parent local cow = 69 local sheep = tostring(cow)
cow.Text = "Money: $" .. sheep
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Jun 2015 06:12 PM |
Jokes on you, it already is a string! It's because you redeclared "cow" to be a number instead of script.Parent.
print 'Hello world!' script.Parent.Text = "Money: $" .. 69; |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2015 06:14 PM |
| Lol I didn't notice that, thanks! |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 11 Jun 2015 06:14 PM |
| Cnt Lua will flip out on you for attempting to concatenate a number with a string as a literal. |
|
|
| Report Abuse |
|
|
Brickagon
|
  |
| Joined: 01 Jun 2015 |
| Total Posts: 366 |
|
|
| 11 Jun 2015 06:14 PM |
yeah you can combine numbers and strings without tostring(). but since you did
cow = (object) local cow = 69
it caused problems use unique variable names for different things |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Jun 2015 06:15 PM |
'Cnt Lua will flip out on you for attempting to concatenate a number with a string as a literal.' r u ok? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 11 Jun 2015 06:17 PM |
| I don't think so it's late. I'm pretty sure Lua will still flip out on you for attempting to concatenate the string with the number, since neither are variables. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Jun 2015 06:19 PM |
It doesn't really matter if they're variables, internally they're both stored the same way (well, locals at least).
local b = "asd".."dsa" and local a = "asd"; local b = a .. "bsd";
will both load "asd" and "dsa" constants into 2 registers and use the concat instruction. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 11 Jun 2015 06:23 PM |
| Huh it totally flipped out last time I tried to make it do an implicit conversion without variables like that. Which was aaaaageeessss ago. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Jun 2015 06:24 PM |
| inb4 you accidentally? used your wrapper and wrapped the string or number (or both) and didn't handle it (correctly?) using __concat |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 11 Jun 2015 06:26 PM |
Aagesss ago was before I even wrapper. I think I tried to perform arithmetic instead and it didn't do the implicit typecast.
Also my wrapper wouldn't mess with that. No locals without the debug library :( |
|
|
| Report Abuse |
|
|