Gubailovo
Well-Known Member
- Joined
- Dec 19, 2013
- Messages
- 412
- Solutions
- 2
- Reaction score
- 71
I want to make freelance weapons. which, after a certain number of strokes, could be transformed into a better one.
\data\actions\lib\actions
\data\actions\scripts\frilanssword
instead of adding blows, he takes them away. This is not critical, you can do -10000. But it's not pretty. If anyone can help I would be grateful.
\data\actions\lib\actions
LUA:
function addCharge(cid, itemuid)
charge = itemUseCharge(itemuid)
doPlayerSendTextMessage(cid,18,"charges: "..charge )
if charge > 10000 then
--doPlayerRemoveItem(cid, itemid, 1)
--doRemoveItem(itemuid, 1)
doPlayerSendTextMessage(cid,20,"The weapon is ready to be upgraded.")
end
end
function tryUseSword(item)
charges = getItemCharges(item.uid)
if chrages < 10000 then
setItemCharges(item.uid, charges + 1)
return true
else
return false
end
end
Code:
addCharge(cid, item.uid)
XML:
<item id="8716" isSword="1" dmax="900000000" charges="20">
</item>
Attachments
-
ezgif.com-gif-maker (1).gif1.2 MB · Views: 22 · VirusTotal