psilocibe
Member
- Joined
- Jul 9, 2007
- Messages
- 479
- Reaction score
- 8
What this code is wrong? It does not work on line 8.
if doPlayerRemoveMoney (cid, 1000) == 1 then
What's happening?
Client. 8.6
if doPlayerRemoveMoney (cid, 1000) == 1 then
What's happening?
Code:
local config = {
cost = 300,
rune_id = 2409,
backpack_id = 1995
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, 300) == 1 then
local name = getItemNameById(2409)
local bp = doPlayerAddItem(cid, config.backpack_id, 1) -- Editing this will not do anything.
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Voce Comprou uma backpack ".. name .."s por ".. config.cost .." golds.")
doSendAnimatedText({x=389,y=368,z=7}, 'Serpent', TEXTCOLOR_WHITE)
doSendMagicEffect({x=389,y=368,z=7}, CONST_ME_STUN)
--doSendAnimatedText(frompos, "Aol 30k", 89)
for i=1,1 do
doAddContainerItem(bp, config.rune_id, 1) -- You can edit this number, it will give shots per rune.
end
else
doPlayerSendCancel(cid, "Voce nao tem ".. config.cost .." golds.")
end
return TRUE
end
Client. 8.6