Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onUse(cid, item, frompos, item2, topos)
- local chance = 70 -- chance de cortar
- local madeiras = {5941, 5901} -- item que o player irá ganhar
- local premio = madeiras[math.random(1, #madeiras)]
- local transformItem = 8786
- local texts = {"Tuc", "Toc", "Trec"}
- local random = texts[math.random(1,#texts)]
- local time = 1 -- Minutos para crescer novamente
- local outfit = 1248 -- ID da Outfit Male.
- local outfit2 = 1249 -- ID da Outfit Female.
- if getPlayerSex(cid) == 1 then
- doSetCreatureOutfit(cid, {lookType = outfit}, 500) -- Tempo em que a outfit estará trocada.
- else
- doSetCreatureOutfit(cid, {lookType = outfit2}, 500) -- Tempo em que a outfit estará trocada.
- end
- doCreatureSetNoMove(cid, true)
- addEvent(function()
- if not isPlayer(cid) then return true end
- doCreatureSetNoMove(cid, false)
- end, 500)
- if item2.itemid == 2702 or item2.itemid == 2703 or item2.itemid == 2704 or item2.itemid == 2705 or item2.itemid == 2706 then
- if math.random(1,100) >= chance then
- doPlayerAddItem(cid,premio, math.random(3, 7))
- doTransformItem(item2.uid, transformItem)
- doSendMagicEffect(topos, 584)
- doSendMagicEffect(frompos, 621)
- doSendAnimatedText(frompos, "Sucess", TEXTCOLOR_WHITE)
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce coletou " .. .. " madeiras.")
- doSendAnimatedText(topos, ""..random.."", TEXTCOLOR_WHITE)
- doDecayItem(item2.uid)
- addEvent(doCreateItem, time*60*1000, item2.itemid, 1, getThingPos(item2.uid))
- else
- doSendAnimatedText(topos, ""..random.."", TEXTCOLOR_WHITE)
- doSendMagicEffect(topos, 584)
- doSendAnimatedText(frompos, "Fail", TEXTCOLOR_WHITE)
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement