Exedion
Active Member
- Joined
- Jun 11, 2007
- Messages
- 629
- Reaction score
- 30
i try to get a number in a item description, but i don't know well how do this, take a look of the item desc:
14:45 You see a Rat sealed rune.
It weighs 1.20 oz.
Health:[5/20]
It master is Test.
i try to return the number "5" and "20" from this desc using:
but i get this error:
can help me PLEASEEE!!
14:45 You see a Rat sealed rune.
It weighs 1.20 oz.
Health:[5/20]
It master is Test.
i try to return the number "5" and "20" from this desc using:
LUA:
local desc = getItemAttribute(item.uid, "description")
local l_health = desc:match('Health:(%[%.-)')
local m_health = desc:match('/(.+)]')
but i get this error:
Code:
[14:27:27.097] [Error - Action Interface]
[14:27:27.097] data/actions/scripts/goback.lua:onUse
[14:27:27.099] Description:
[14:27:27.099] data/actions/scripts/goback.lua:35: attempt to perform arithmetic
on local 'l_health' (a string value)
[14:27:27.100] stack traceback:
[14:27:27.101] data/actions/scripts/goback.lua:35: in function <data/actions/sc
ripts/goback.lua:1>
can help me PLEASEEE!!