Lurk
Active Member
- Joined
- Dec 4, 2017
- Messages
- 336
- Reaction score
- 49
hello, I have a refine system on my server and I want to make it so when a player has a specfic wepon at level 16 he can change that weapon for another one, thing is, these upgrade weapons' level are defined by its name, so a Giant Sword that was refined 1 time would be called a Giant Sword +1
I was looking at a lua functions list and didn't find a method to check item names, the closest I found was getItemNameById but that's not good enough I believe
Honestly just knowing a method to check the item name will be enough (is possible at all), any idea?
edit: actually, just found a
but how can I use this?
edit:
got this error
when testing like this
I was looking at a lua functions list and didn't find a method to check item names, the closest I found was getItemNameById but that's not good enough I believe
Honestly just knowing a method to check the item name will be enough (is possible at all), any idea?
edit: actually, just found a
Code:
getItemName(uid)
edit:
got this error
[8:52:48.904] [Error - TalkAction Interface]
[8:52:48.904] data/talkactions/scripts/trocaritems.lua:onSay
[8:52:48.904] Description:
[8:52:48.904] data/lib/050-function.lua:253: attempt to index a boolean value
[8:52:48.905] stack traceback:
[8:52:48.906] data/lib/050-function.lua:253: in function 'getItemName'
[8:52:48.906] data/talkactions/scripts/trocaritems.lua:9: in function <data/talkactions/scripts/trocaritems.lua:1>
when testing like this
LUA:
if param == "wand" then
if getItemName(uid) == "Star wand +16" then
doPlayerSendTextMessage(cid, 22, "Você fez uma troca de items!")
--doPlayerRemoveItem(cid, 12609)
doPlayerRemoveItem(cid, table["wand"].id, 1)
doPlayerAddItem(cid, table["wand"].toid, 1)
else
doPlayerSendCancel(cid, "Você não tem o item necessário!")
end
return true
end
Last edited: