Postado Outubro 6, 2018 6 anos local config, tab = { creatures = { [1] = "Jack Sparrow", [2] = "Catatau", [3] = "Belmont's Revenge" }, positions = { [1] = {x = 386, y = 154, z = 7}, [2] = {x = 388, y = 154, z = 7}, [3] = {x = 390, y = 154, z = 7} }, price = 1, amountReward = 10, cassinoCoin = 6527, }, {} local function createMonster(creature, position) doCreateMonster(creature, position) doSendMagicEffect(position, 26) addEvent(doSendMagicEffect, 100, position, 37) return true end function onUse(cid, item, fromPosition, itemEx, toPosition) if getGlobalStorageValue(82192) > os.time() then doPlayerSendCancel(cid, "Aguarde um pouco para apostar.") return true end if getPlayerItemCount(cid, config.cassinoCoin) < 1 then doPlayerSendCancel(cid, "Você precisa de " .. price .. " " .. getItemNameById(config.cassinoCoin) .." para jogar.") return true end setGlobalStorageValue(82192, os.time() + 6) for i = 1, #config.positions do doSendMagicEffect(config.positions[i], 37) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) doPlayerRemoveItem(cid, config.cassinoCoin, config.price) for i = 1, #config.positions do local pos, creature = config.positions[i], math.random(1, #config.creatures) createMonster(creature, pos) tab[#tab + 1] = creature if i ~= 1 then if i == 2 then addEvent(createMonster, 1700, creature, pos) else addEvent(createMonster, 2000, creature, pos) end end end addEvent(function() for i = 1, #config.positions do local pos = config.positions[i] doRemoveCreature(getTopCreature(pos).uid) doSendMagicEffect(pos, 61) end if tab[1] == tab[2] and tab[1] == tab[3] then doPlayerAddItem(cid, config.cassinoCoin, config.amountReward) doSendAnimatedText(getThingPos(cid), "VOCE", 25) addEvent(doSendAnimatedText, 800, getThingPos(cid), "GANHOU", 25) addEvent(doSendAnimatedText, 1600, getThingPos(cid), "30", 25) addEvent(doSendAnimatedText, 3000, getThingPos(cid), "EVENTCOINS", 25) for i = 1, #config.positions do local pos = config.positions[i] doSendMagicEffect(pos, 30) end for i = 1, #config.positions do local pos = config.positions[i] addEvent(doSendMagicEffect, 800, pos, 29) end for i = 1, #config.positions do local pos = config.positions[i] addEvent(doSendMagicEffect, 1600, pos, 28) end doSendMagicEffect(getThingPos(cid), 30) addEvent(doSendMagicEffect, 800, getThingPos(cid), 29) addEvent(doSendMagicEffect, 1600, getThingPos(cid), 28) else doSendAnimatedText(getThingPos(cid), "VOCE", 200) addEvent(doSendAnimatedText, 800, getThingPos(cid), "PERDEU", 200) addEvent(doSendAnimatedText, 1600, getThingPos(cid), "HAHA", 200) end end, 4200) return true end
Postado Outubro 6, 2018 6 anos Autor @FlavioHulk Agora o script funcionou, usa a moeda que eu quero e dá a moeda que eu quero, o problema é que os bixos não estão aparecendo e toda vez acerta por causa disso e sem a moeda dá esse erro ps: meu sistema é linux data/actions/scripts/Killua Cassino.lua:onUse Description: data/actions/scripts/Killua Cassino.lua:31: attempt to concatenate global 'price' (a nil value) stack traceback: data/actions/scripts/Killua Cassino.lua:31: in function com a moeda da esse erro [Error - Action Interface] data/actions/scripts/Killua Cassino.lua:onUse Description: (luaDoCreateMonster) Monster with name '2' not found [Error - Action Interface] In a timer event called from: data/actions/scripts/Killua Cassino.lua:onUse Description: (luaDoCreateMonster) Monster with name '2' not found [Error - Action Interface] In a timer event called from: data/actions/scripts/Killua Cassino.lua:onUse Description: (luaDoCreateMonster) Monster with name '2' not found
Postado Outubro 6, 2018 6 anos local config, tab = { creatures = { [1] = "Jack Sparrow", [2] = "Catatau", [3] = "Belmont's Revenge" }, positions = { [1] = {x = 386, y = 154, z = 7}, [2] = {x = 388, y = 154, z = 7}, [3] = {x = 390, y = 154, z = 7} }, price = 1, amountReward = 10, cassinoCoin = 6527, }, {} local function createMonster(creature, position) doCreateMonster(creature, position) doSendMagicEffect(position, 26) addEvent(doSendMagicEffect, 100, position, 37) return true end function onUse(cid, item, fromPosition, itemEx, toPosition) if getGlobalStorageValue(82192) > os.time() then doPlayerSendCancel(cid, "Aguarde um pouco para apostar.") return true end if getPlayerItemCount(cid, config.cassinoCoin) < 1 then doPlayerSendCancel(cid, "Você precisa de " .. config.price .. " " .. getItemNameById(config.cassinoCoin) .." para jogar.") return true end setGlobalStorageValue(82192, os.time() + 6) for i = 1, #config.positions do doSendMagicEffect(config.positions[i], 37) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) doPlayerRemoveItem(cid, config.cassinoCoin, config.price) for i = 1, #config.positions do local pos, random = config.positions[i], math.random(1, #config.creatures) local creature = config.creatures[random] createMonster(creature, pos) tab[#tab + 1] = random if i ~= 1 then if i == 2 then addEvent(createMonster, 1700, creature, pos) else addEvent(createMonster, 2000, creature, pos) end end end addEvent(function() for i = 1, #config.positions do local pos = config.positions[i] doRemoveCreature(getTopCreature(pos).uid) doSendMagicEffect(pos, 61) end if tab[1] == tab[2] and tab[1] == tab[3] then doPlayerAddItem(cid, config.cassinoCoin, config.amountReward) doSendAnimatedText(getThingPos(cid), "VOCE", 25) addEvent(doSendAnimatedText, 800, getThingPos(cid), "GANHOU", 25) addEvent(doSendAnimatedText, 1600, getThingPos(cid), "30", 25) addEvent(doSendAnimatedText, 3000, getThingPos(cid), "EVENTCOINS", 25) for i = 1, #config.positions do local pos = config.positions[i] doSendMagicEffect(pos, 30) end for i = 1, #config.positions do local pos = config.positions[i] addEvent(doSendMagicEffect, 800, pos, 29) end for i = 1, #config.positions do local pos = config.positions[i] addEvent(doSendMagicEffect, 1600, pos, 28) end doSendMagicEffect(getThingPos(cid), 30) addEvent(doSendMagicEffect, 800, getThingPos(cid), 29) addEvent(doSendMagicEffect, 1600, getThingPos(cid), 28) else doSendAnimatedText(getThingPos(cid), "VOCE", 200) addEvent(doSendAnimatedText, 800, getThingPos(cid), "PERDEU", 200) addEvent(doSendAnimatedText, 1600, getThingPos(cid), "HAHA", 200) end end, 4200) return true end Vai testando haha !
Postado Outubro 6, 2018 6 anos Autor @FlavioHulk DSAKDKDASKDASKK agora o negocio é o seguinte, quando nao tem o item, fica bom, fala a mensagem: voce precisa de ..... ate ai ok quando eu tenho o item, funciona, porem os não da o efeito, da um bug, e apenas aparece os 3 de uma x e da esse erro Citar [Error - Action Interface] In a timer event called from: data/actions/scripts/Killua Cassino.lua:onUse Description: (luaDoCreateMonster) Cannot create monster: Catatau [Error - Action Interface] In a timer event called from: data/actions/scripts/Killua Cassino.lua:onUse Description: (luaDoCreateMonster) Cannot create monster: Belmont's Revenge [Error - Action Interface] In a timer event called from: data/actions/scripts/Killua Cassino.lua:onUse Description: (luaDoCreateMonster) Cannot create monster: Jack Sparrow se eu deixar qualquer erro, o vps não aceita se for melhor para você, apenas editar o arquivo lua que eu falei no primeiro tópico, seria bom para ambos, mas msm assim, muito obrigado
Postado Outubro 6, 2018 6 anos Solução local bixos = {"Jack Sparrow", "Catatau", "Belmont's Revenge"} local positions = {{x = 386, y = 154, z = 7}, {x = 388, y = 154, z = 7}, {x = 390, y = 154, z = 7}} -- Posicao q os bixos nascem local price = 1 -- Preco para jogar local cassinoCoin = 6527 function onUse(cid, item, fromPosition, itemEx, toPosition) local first = math.random(1, #bixos) local second = math.random(1, #bixos) local third = math.random(1, #bixos) local tab = {} local recheck = 0 if getGlobalStorageValue(82192) > os.time() then doPlayerSendCancel(cid, "Aguarde um pouco para apostar.") return true end if getPlayerItemCount(cid, cassinoCoin) < 1 then doPlayerSendCancel(cid, "Você precisa de " .. price .. " " .. getItemNameById(cassinoCoin) .." para jogar.") return true end setGlobalStorageValue(82192, os.time() + 6) for i = 1, (#positions) do doSendMagicEffect(positions, 37) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) doPlayerRemoveItem(cid, cassinoCoin, price) doCreateMonster(bixos[first], positions[1]) doSendMagicEffect(positions[1], 26) addEvent(doSendMagicEffect, 100, positions[1], 37) table.insert(tab, first) setGlobalStorageValue(bixos[first], getGlobalStorageValue(bixos[first])+1) addEvent(function() doCreateMonster(bixos[second], positions[2]) doSendMagicEffect(positions[2], 26) addEvent(doSendMagicEffect, 100, positions[2], 37) table.insert(tab, second) end, 1700) addEvent(function() doCreateMonster(bixos[third], positions[3]) doSendMagicEffect(positions[3], 26) addEvent(doSendMagicEffect, 100, positions[3], 37) setGlobalStorageValue(bixos[third], getGlobalStorageValue(bixos[third])+1) table.insert(tab, third) end, 2000) addEvent(function() doRemoveCreature(getTopCreature(positions[1]).uid) doRemoveCreature(getTopCreature(positions[2]).uid) doRemoveCreature(getTopCreature(positions[3]).uid) doSendMagicEffect(positions[1], 61) doSendMagicEffect(positions[2], 61) doSendMagicEffect(positions[3], 61) if tab[1] == tab[2] and tab[1] == tab[3] then doPlayerAddItem(cid, cassinoCoin, 10) doSendAnimatedText(getThingPos(cid), "VOCE", 25) addEvent(doSendAnimatedText, 800, getThingPos(cid), "GANHOU", 25) addEvent(doSendAnimatedText, 1600, getThingPos(cid), "30", 25) addEvent(doSendAnimatedText, 3000, getThingPos(cid), "EVENTCOINS", 25) doSendMagicEffect(getThingPos(cid), 30) doSendMagicEffect(positions[1], 30) doSendMagicEffect(positions[2], 30) doSendMagicEffect(positions[3], 30) addEvent(doSendMagicEffect, 800, getThingPos(cid), 29) addEvent(doSendMagicEffect, 800, positions[1], 29) addEvent(doSendMagicEffect, 800, positions[2], 29) addEvent(doSendMagicEffect, 800, positions[3], 29) addEvent(doSendMagicEffect, 1600, getThingPos(cid), 28) addEvent(doSendMagicEffect, 1600, positions[1], 28) addEvent(doSendMagicEffect, 1600, positions[2], 28) addEvent(doSendMagicEffect, 1600, positions[3], 28) else doSendAnimatedText(getThingPos(cid), "VOCE", 200) addEvent(doSendAnimatedText, 800, getThingPos(cid), "PERDEU", 200) addEvent(doSendAnimatedText, 1600, getThingPos(cid), "HAHA", 200) end end, 4200) 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.