Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local breakChance = 60
- local rustyItems = {
- -- [fromItemId] = toItemId,
- [epicItemId] = diamondItemId,
- }
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- local newId = rustyItems[itemEx.itemid]
- if newId then
- if math.random(100) <= breakChance then
- doRemoveItem(itemEx.uid)
- doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You broke it.")
- else
- doTransformItem(itemEx.uid, newId)
- doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You removed the rust, revealing a "..getItemNameById(newId))
- end
- doRemoveItem(item.uid,1)
- return TRUE
- end
- return FALSE
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement