Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onUse(cid, item, fromposition, itemEx, toposition)
- local config ={
- ["1-400"] = {items = 8298, text = "SUCESSO", colortext = 139, msg = "Você adquiriu 1 pedra(s) de refinamento nível 1"},
- ["400-700"] = {items = 8299, text = "SUCESSO", colortext = TEXTCOLOR_GREY, msg = "Você adquiriu 1 pedra(s) de refinamento nível 2"},
- ["700-850"] = {items = 8301, text = "SUCESSO", colortext = 210, msg = "Você adquiriu 1 pedra(s) de refinamento nível 3"},
- ["850-925"] = {items = 8302, text = "SUCESSO", colortext = 64,msg = "Você adquiriu 1 pedra(s) de refinamento nível 4"},
- ["925-999"] = {items = 8303, text = "SUCESSO", colortext = TEXTCOLOR_PURPLE , msg = "Você adquiriu 1 pedra(s) de refinamento nível 5"},
- ["999-1000"] = {items = 9971, text = "G-INGOT!", colortext = 208, ,msg = "Você adquiriu 1 gold ingot(s)"},
- }
- local rand = math.random(1, 1005)
- if getPlayerLevel(cid) <= 124 then
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não tem nível 125+ para ter acesso a mineração!")
- return true
- end
- if getPlayerStorageValue(cid,8749) < 1 then
- return true
- end
- if itemEx.itemid >= 1353 and itemEx.itemid <= 1354 or itemEx.itemid == 1355 then
- for chance, v in pairs(config) do
- local c = string.explode(string:lower(chance), "-")
- if rand >= tonumber(c[1]) and rand <= tonumber(c[2]) then
- doSendAnimatedText(toposition, v.text , v.colortext)
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, v.msg)
- doSendMagicEffect(toposition,12)
- doPlayerAddItem(cid, v.items, 1)
- break
- else
- doSendAnimatedText(toposition,'FALHOU!', TEXTCOLOR_RED)
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua mineração falhou. Tente novamente ")
- doSendMagicEffect(toposition,2)
- end
- end
- end
- return true
- endd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement