• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ new tfs cant use percentages

Mjmackan

Mapper ~ Writer
Premium User
Joined
Jul 18, 2009
Messages
1,424
Solutions
15
Reaction score
177
Location
Sweden
With new TFS 1.4 I can't seem to be able to add '%' into any text, I'm recieving error.
Code snippet:
Lua:
item:setAttribute(ITEM_ATTRIBUTE_NAME, "1000%")
When removing the %, it the name shows, but not the % ofcourse.
Lua Script Error: [Event Interface]
data/events/scripts/player.lua:player@onLook
data/lib/core/item.lua:45: bad argument #2 to 'format' (no value)
stack traceback:
[C]: at 0x7ff786756630
[C]: in function 'format'
data/lib/core/item.lua:45: in function 'append'
data/lib/core/item.lua:263: in function 'getDescription'
...14\data\scripts\eventcallbacks\player\default_onLook.lua:4: in function <...14\data\scripts\eventcallbacks\player\default_onLook.lua:3>
C:\GameFatev2 -vc14\data\scripts/lib\event_callbacks.lua:127: in function 'EventCallback'
data/events/scripts/player.lua:11: in function <data/events/scripts/player.lua:8>
 
With new TFS 1.4 I can't seem to be able to add '%' into any text, I'm recieving error.
Code snippet:
Lua:
item:setAttribute(ITEM_ATTRIBUTE_NAME, "1000%")
When removing the %, it the name shows, but not the % ofcourse.
This isn't a problem with tfs, its with lua. You are using a symbol commonly used for formatting strings, and since you have it in the string, without any function calls, methods, or formatting of any kind to be input, it throws an error.

You can learn more about your options with lua and strings here.

 
This isn't a problem with tfs, its with lua. You are using a symbol commonly used for formatting strings, and since you have it in the string, without any function calls, methods, or formatting of any kind to be input, it throws an error.

You can learn more about your options with lua and strings here.

But it worked with and still work on a older tfs 1.3 repo.
 
Back
Top