• 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!

Action Soft Repair Talon

ignas1415

Senior Member
Joined
May 15, 2008
Messages
54
Reaction score
0
Location
Europa/Poland
I welcome you today to present the coupon which replaces worn soft boots with new ones. Just click on the coupon and now we have new soft boots. Voucher single-use

data/actions/scripts add soft.lua and paste it
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerItemCount(cid, 6530) >= 1 then
if doPlayerTakeItem(cid,6527,1) == 0 then
local item = getPlayerItemById(cid, TRUE, 6530)
doTransformItem(item.uid, 2640) 
doPlayerSendTextMessage(cid, 20, 'Congratulations, you have already renewed shoes.')

else
doPlayerSendTextMessage(cid, 20, 'You do not have worn soft boot so not allowed to renew their')
end
end
end
and in actions/actions.xml add:


<action itemid="6527" script="soft.lua"/>
 
Last edited by a moderator:
It's a very nice idea, so i dont like the part of you can bot for hours and use the repair talon.
I preffer the old method of the NPC Repair, or make player pay a fee for using the talon not else the NPC.

Ah, you should consider tab your code :)

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
     
     if doPlayerTakeItem(cid,6527,1) == 0 then
          local item = getPlayerItemById(cid, TRUE, 6530)
          doTransformItem(item.uid, 2640) 
          doPlayerSendTextMessage(cid, 20, 'Congratulations, you have already renewed shoes.')
     else
          doPlayerSendTextMessage(cid, 20, 'You do not have worn soft boot so not allowed to renew their')
     end
    return TRUE

end

getItemCount is not useless, why count it if you know it will be removed if have? doPlayerTakeItem already do this for you :)
 
Back
Top