Postado Outubro 20, 2023 1 ano Solução doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, " .. [playerName] .. " apostou no cassino e ganhou " .. getItemNameById ..") sem função -- Cassino System by LucasHere function onUse(cid, item, frompos, item2, topos) pos1 = {x=272, y=344, z=7, stackpos=1} --posição que vai criar os itens pos2 = {x=273, y=344, z=7, stackpos=1} pos3 = {x=274, y=344, z=7, stackpos=1} local config = { moneyneed = 1, -- quantidade de moedas VIP necessárias para jogar chance = 20 -- chance de 20% para cada item } local premios = { [8976] = 1, [8982] = 1, [8981] = 1, [5884] = 1, [6105] = 1, [8985] = 1, [7738] = 1 } function additem(cid, premios) for itemId, quantity in pairs(premios) do -- Verifica se o item deve ser dado com base na chance configurada if math.random(1, 100) <= config.chance then doPlayerAddItem(cid, itemId, quantity) end end local playerName = getPlayerName(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, [playerName] .. " apostou no cassino e ganhou " .. itemName") end if item.itemid == 10029 and getPlayerItemCount(cid, 6535) < config.moneyneed then doCreatureSay(cid, "Voce Precisa de 1 DexSoft Coin Para Apostar!", TALKTYPE_ORANGE_1) return true end if item.itemid == 10029 then doTransformItem(item.uid, 10029) doPlayerRemoveItem(cid, 6535, config.moneyneed) local premioItems = premios addEvent(doCreateItem, 0, premioItems, pos1) addEvent(doCreateItem, 1000, premioItems, pos2) addEvent(doCreateItem, 2000, premioItems, pos3) addEvent(additem, 2000, cid, premioItems) return true end local item0 = getThingfromPos(pos1) local item1 = getThingfromPos(pos2) local item2 = getThingfromPos(pos3) if item.itemid == 10029 then doTransformItem(item.uid, 10029) if item0.itemid ~= 0 then doRemoveItem(item0.uid, 1) end if item1.itemid ~= 0 then doRemoveItem(item1.uid, 1) end if item2.itemid ~= 0 then doRemoveItem(item2.uid, 1) end else doTransformItem(item.uid, 10029) end return true end
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.