juansanchez
Intermediate OT User
- Joined
- Apr 2, 2015
- Messages
- 217
- Reaction score
- 130
Hey guys, so, as the title says, i need help with a talkaction. I just got this !softboots talkactions (gets used soft, makes a new one), and i want players to first do a specific quest, to then be able to use the talkaction.
I know i have to use storages, but i'm just bad at scripting on lua. I tried doing it myself, but couldn't make it work, here is how i tried doing it:
I hope someone can help me out.
I'm using TFS 0.3.6. Thanks in advance if anyone is able to help.
I know i have to use storages, but i'm just bad at scripting on lua. I tried doing it myself, but couldn't make it work, here is how i tried doing it:
function onSay(cid, words, param)
cost = 300000
pos = getPlayerPosition(cid)
if getPlayerStorageValue(cid, 281921) == 1 then
if getPlayerItemCount(cid, 10021) >= 1 then
if doPlayerRemoveMoney(cid,cost) == TRUE then
doSendMagicEffect(pos, 28)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Botas magicas recuperadas!")
doPlayerAddItem(cid, 6132, 1)
doPlayerRemoveItem(cid, 10021, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce nao tem dinheiro suficiente.")
doSendMagicEffect(pos, 2)
end
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce nao tem um par de botas magicas gastas para recuperar.")
doSendMagicEffect(pos, 2)
else
doPlayerSendCancel(cid, "Voce precisa completar a quest para usar este comando")
return false
end
end
end
I hope someone can help me out.
I'm using TFS 0.3.6. Thanks in advance if anyone is able to help.