Ir para conteúdo

thalia

Membro
  • Registro em

  • Última visita

Tudo que thalia postou

  1. kkkkkkkkkkkkkk! vo postar sim
  2. Muito bom script demonbholder REP for you
  3. HUAHDHASHDUHAUSDHUHASUDHAHSUDHU thanks
  4. @Renato Se tiver um item chamado list, bom .. enfim @demonbholder Sim vc está certo, mais se o item não for agrupavel e botar ali exemplo, 4. vai vim 1 e cobrar preço de 1 mesmo, então n tem problema XD .. Futuramente eu melhoro esse script!
  5. Nome: Ganhe cash ao matar alguem. Versão: Testada tfs 0.3.6 (8.54), provavelmente funfa em 8.54 + Créditos: Eu e para o demonbholder por me ajudar a fazer a lista. Como funciona? Quando você mata um player você ganha 100 cash (Pode ser alterado no script), e falano: ~~> /buy nome_do_item (Exemplo: /buy plate armor), você automaticamente comprara o item. ~~> /buy list, você vera os itens que pode ser comprados e o preço deles. ~~> /buy check, verifica quantos de cash você tem. Instalando o sistema ! 1ª: Entre na pasta data/creaturescripts/scripts, e crie um arquivo chamado cash.lua, cole este código dentro: function onKill(cid, target, lastHit) local cash = 150 -- O tanto de cash que ira ganhar ao matar o player if isPlayer(cid) and isPlayer(target) then if getPlayerIp(target) ~= getPlayerIp(cid) then setPlayerStorageValue(cid, 45550, (getPlayerStorageValue(cid, 45550)+cash)) end end return TRUE end 2ªa: Agora em creaturescripts/creaturescripts.xml bote a tag: <event type="kill" name="Kill_Cash" event="script" value="cash.lua"/> 2ªb:Agora em creaturescripts/scripts , localize login.lua (antes do ultimo return true) e cole isto dentro: registerCreatureEvent(cid, "Kill_Cash") 3ª:Voltando em data/talkactions/scripts crie um arquivo com o nome de cash.lua e cole isto dentro: -- Script by: thalia -- local item = { ["plate armor"] = {cash=150, id=2463, amount=1}, ["plate legs"] = {cash=150, id=2647, amount=1}, } function onSay(cid, words, param) itens = item[param] if param == "check" then return doPlayerSendTextMessage(cid,19,'Your total cash is '..getPlayerStorageValue(cid, 45550)..'.') elseif param == "list" then str = nil for name, tab in pairs(item) do str = str == nil and "Item name: "..name.." - Price: "..tab.cash .. "\n" or str .. "Item name: "..name.." - Price: "..tab.cash .. "\n" end doShowTextDialog(cid, 2160, str) return true end if (itens ~= nil) then if getPlayerStorageValue(cid, 45550) >= itens.cash then doSendMagicEffect(getThingPos(cid),28) doPlayerAddItem(cid,itens.id,itens.amount) setPlayerStorageValue(cid, 45550, (getPlayerStorageValue(cid,45550)-itens.cash)) return doPlayerSendTextMessage(cid,19,'Your total cash now is '..getPlayerStorageValue(cid, 45550)..'.') else return doPlayerSendCancel(cid,"Sorry, cash insufficient.") end else return doPlayerSendCancel(cid,"Sorry, this item is not for sale.") end return TRUE end 4ª:Agora em talkactions/talkactions.xml bote está tag: <talkaction log="yes" words="/buy" access="0" event="script" value="cash.lua"/> Prontinho, script istalado... Ai vocês me pergunta: Como adicionar mais itens? E eu respondo: Simples Nesta parte: È só adicionar: BOM È ISSO COMENTEM O QUE ACHARAM! È só fazer isso um em baixo do outro.
  6. thalia postou uma resposta no tópico em Tutoriais sobre Scripting
    [LUA] Lista De Funções Esta lista contêm todas ou quase todas as funções LUA do The Forgotten Server 1. Funções #get getCreatureHealth(cid) getCreatureMaxHealth(cid) getCreatureMana(cid) getCreatureMaxMana(cid) getCreatureMaster(cid) getCreatureSummons(cid) getCreatureOutfit(cid) getCreaturePosition(cid) getCreatureName(cid) getCreatureSpeed(cid) getCreatureBaseSpeed(cid) getCreatureTarget(cid) getCreatureByName(name) getCreatureSkullType(cid) getCreatureCondition(cid, condition[, subId]) getCreatureNoMove(cid) getMonsterInfo(name) getMonsterHealingSpells(name) getMonsterAttackSpells(name) getMonsterLootList(name) getMonsterTargetList(cid) getMonsterFriendList(cid) getPlayerByNameWildcard(name~) getPlayerLossSkill(cid) getPlayerLossPercent(cid, lossType) getPlayerGUIDByName(name[, multiworld]) getPlayerNameByGUID(guid[, multiworld]) getPlayerFood(cid) getPlayerLevel(cid) getPlayerExperience(cid) getPlayerMagLevel(cid[, ignoreBuffs]) getPlayerSpentMana(cid) getPlayerAccess(cid) getPlayerSkillLevel(cid, skillid) getPlayerSkillTries(cid, skillid) getPlayerTown(cid) getPlayerVocation(cid) getPlayerRequiredMana(cid, magicLevel) getPlayerRequiredSkillTries(cid, skillId, skillLevel) getPlayerItemCount(cid, itemid) getPlayerSoul(cid) getPlayerAccountId(cid) getPlayerAccount(cid) getPlayerIp(cid) getPlayerFreeCap(cid) getPlayerLight(cid) getPlayerSlotItem(cid, slot) getPlayerWeapon(cid[, ignoreAmmo]) getPlayerItemById(cid, deepSearch, itemId[, subType]) getPlayerDepotItems(cid, depotid) getPlayerGuildId(cid) getPlayerGuildName(cid) getPlayerGuildRank(cid) getPlayerGuildNick(cid) getPlayerGuildLevel(cid) getPlayerSex(cid) getPlayerLookDir(cid) getPlayerStorageValue(uid, valueid) getPlayerGUID(cid) getPlayerFlagValue(cid, flag) getPlayerCustomFlagValue(cid, flag) getPlayerPromotionLevel(cid) getPlayerGroupId(cid) getPlayerLearnedInstantSpell(cid, name) getPlayerInstantSpellCount(cid) getPlayerInstantSpellInfo(cid, index) getPlayerSex(cid) getPlayerBlessing(cid, blessing) getPlayerStamina(cid) getPlayerExtraExpRate(cid) getPlayerPartner(cid) getPlayerParty(cid) getPlayerPremiumDays(cid) getPlayerBalance(cid) getPlayerRedSkullTicks(cid) getPlayerRates(cid) getInstantSpellInfo(cid, name) getPlayersByAccountId(accountNumber) getPlayersByIp(ip[, mask = 0xFFFFFFFF]) getPlayersOnline() getPartyMembers(lid) getAccountIdByName(name) getAccountByName(name) getAccountIdByAccount(accName) getAccountByAccountId(accId) getIpByName(name) getItemRWInfo(uid) getItemDescriptionsById(itemid) getItemWeightById(itemid, count[, precise]) getItemDescriptions(uid) getItemWeight(uid[, precise]) getItemAttack(uid) getItemExtraAttack(uid) getItemDefense(uid) getItemExtraDefense(uid) getItemArmor(uid) getItemAttackSpeed(uid) getItemHitChance(uid) getItemShootRange(uid) getItemIdByName(name[, reportError]) getItemLevelDoor(itemid) getItemWeaponType(uid) getFluidSourceType(type) getContainerSize(uid) getContainerCap(uid) getContainerCapById(itemid) getContainerItem(uid, slot) getDepotId(uid) getTileItemById(pos, itemId[, subType]) getTileItemByType(pos, type) getTileThingByPos(pos) getTileInfo(pos) getTopCreature(pos) getClosestFreeTile(cid, targetpos[, extended[, ignoreHouse]]) getThingFromPos(pos) getThing(uid) getThingPos(uid) getHouseOwner(houseid) getHouseName(houseid) getHouseEntry(houseid) getHouseRent(houseid) getHousePrice(houseid) getHouseTown(houseid) getHouseAccessList(houseid, listid) getHouseByPlayerGUID(playerGUID) getHouseFromPos(pos) getHouseTilesSize(houseid) getTownId(townName) getTownName(townId) getTownTemplePosition(townId) getTownHouses(townId) getWorldType() getWorldTime() getWorldLight() getWorldCreatures(type) //0 players, 1 monsters, 2 npcs, 3 all getWorldUpTime() getHighscoreString(skillId) getVocationInfo(id) getGuildId(guildName) getGuildMotd(guildId) getSpectators(centerPos, rangex, rangey, multifloor) getSearchString(fromPosition, toPosition[, fromIsCreature[, toIsCreature]]) getWaypointPosition(name) getGameState() getNotationsCount(accId) getBanData(value) getBanList(type[, value]) getBanReason(id) getBanAction(id[, ipBanishment]) getGlobalStorageValue(valueid) getExperienceStage(level) getConfigFile() getConfigValue(key) getLogsDir() getDataDir() 2. Funções #set setCreatureMaxHealth(cid, health) setCreatureMaxMana(cid, mana) setPlayerStorageValue(uid, valueid, newvalue) setPlayerGroupId(cid, newGroupId) setPlayerPromotionLevel(cid, level) setPlayerStamina(cid, minutes) setPlayerExtraExpRate(cid, value) setPlayerPartner(cid, guid) setHouseOwner(houseid, ownerGUID) setHouseAccessList(houseid, listid, listtext) setItemName(uid) setItemPluralName(uid) setItemArticle(uid) setItemAttack(uid, attack) setItemExtraAttack(uid, extraattack) setItemDefense(uid, defense) setItemArmor(uid, armor) setItemExtraDefense(uid, extradefense) setItemAttackSpeed(uid, attackspeed) setItemHitChance(uid, hitChance) setItemShootRange(uid, shootRange) setCombatArea(combat, area) setCombatCondition(combat, condition) setCombatParam(combat, key, value) setConditionParam(condition, key, value) setCombatCallBack(combat, key, function_name) setCombatFormula(combat, type, mina, minb, maxa, maxb) setConditionFormula(combat, mina, minb, maxa, maxb) setGlobalStorageValue(valueid, newvalue) setWorldType(type) 3. Funções #do doCreatureAddHealth(cid, health[, force]) doCreatureAddMana(cid, mana) doCreatureSetDropLoot(cid, doDrop) doCreatureSetSkullType(cid, skull) doCreatureSetLookDir(cid, dir) doCreatureChangeOutfit(cid, outfit) doCreatureSay(cid, text, type[, pos]) doCreatureSetNoMove(cid, cannotMove) doSetCreatureLight(cid, lightLevel, lightColor, time) doSetCreatureOutfit(cid, outfit, time) doRemoveCreature(cid) doMoveCreature(cid, direction) doConvinceCreature(cid, target) doChallengeCreature(cid, target) doChangeSpeed(cid, delta) doSummonMonster(name, pos) doCreateMonster(name, pos) doMonsterChangeTarget(cid) doMonsterSetTarget(cid, target) doCreateNpc(name, pos) doSetMonsterOutfit(cid, name, time) doPlayerBroadcastMessage(cid, message[, type]) doPlayerSetSex(cid, newSex) doPlayerSetTown(cid, townid) doPlayerSetVocation(cid,voc) doPlayerRemoveItem(cid, itemid, count[, subtype]) doPlayerAddExp(cid, exp) doPlayerSetGuildId(cid, id) doPlayerSetGuildRank(cid, rank) doPlayerSetGuildNick(cid, nick) doPlayerAddOutfit(cid,looktype, addons) doPlayerRemoveOutfit(cid,looktype, addons) doPlayerSetRedSkullTicks(cid, amount) doPlayerSetLossPercent(cid, lossType, newPercent) doPlayerSetLossSkill(cid, doLose) doPlayerAddSkillTry(cid, skillid, n) doPlayerAddSpentMana(cid, amount) doPlayerAddSoul(cid, soul) doPlayerAddItem(uid, itemid[, count/subtype[, canDropOnMap]]) doPlayerAddItemEx(cid, uid[, canDropOnMap]) doPlayerSendTextMessage(cid, MessageClasses, message) doPlayerSendChannelMessage(cid, author, message, SpeakClasses, channel) doPlayerSendToChannel(cid, targetId, SpeakClasses, message, channel[, time]) doPlayerAddMoney(cid, money) doPlayerRemoveMoney(cid, money) doPlayerWithdrawMoney(cid, money) doPlayerDepositMoney(cid, money) doPlayerTransferMoneyTo(cid, target, money) doPlayerPopupFYI(cid, message) doPlayerSendTutorial(cid, id) doPlayerAddMapMark(cid, pos, type[, description]) doPlayerAddPremiumDays(cid, days) doPlayerAddBlessing(cid, blessing) doPlayerAddStamina(cid, minutes) doPlayerResetIdleTime(cid) doPlayerLearnInstantSpell(cid, name) doPlayerUnlearnInstantSpell(cid, name) doPlayerFeed(cid, food) doPlayerSendCancel(cid, text) doPlayerSendDefaultCancel(cid, ReturnValue) doPlayerSetExperienceRate(cid, value) doPlayerSetMagicRate(cid, value) doPlayerSetSkillRate(cid, skill, value) doPlayerJoinParty(cid, lid) doPlayerSendOutfitWindow(cid) doCreateItem(itemid, type/count, pos) doCreateItemEx(itemid[, count/subtype]) doAddContainerItemEx(uid, virtuid) doAddContainerItem(uid, itemid[, count/subtype]) doChangeTypeItem(uid, newtype) doDecayItem(uid) doRemoveItem(uid[, n]) doTransformItem(uid, toitemid[, count/subtype]) doSetItemActionId(uid, actionid) doSetItemText(uid, text[, writer[, date]]) doSetItemSpecialDescription(uid, desc) doSetItemOutfit(cid, item, time) doTileAddItemEx(pos, uid) doTileQueryAdd(uid, pos[, flags]) doAddCondition(cid, condition) doRemoveCondition(cid, type[, subId]) doRemoveConditions(cid[, onlyPersistent]) doAreaCombatHealth(cid, type, pos, area, min, max, effect) doTargetCombatHealth(cid, target, type, min, max, effect) doAreaCombatMana(cid, pos, area, min, max, effect) doTargetCombatMana(cid, target, min, max, effect) doAreaCombatCondition(cid, pos, area, condition, effect) doTargetCombatCondition(cid, target, condition, effect) doAreaCombatDispel(cid, pos, area, type, effect) doTargetCombatDispel(cid, target, type, effect) doCombat(cid, combat, param) doTeleportThing(cid, newpos[, pushmove]) doCreateTeleport(itemid, topos, createpos) doSendMagicEffect(pos, type[, creature]) doSendDistanceShoot(frompos, topos, type[, creature]) doSendAnimatedText(pos, text, color[, creature]) doShowTextDialog(cid, itemid, text) doRelocate(pos, posTo) doBroadcastMessage(message, type) doWaypointAddTemporial(name, pos) doSetGameState(id) doAddIpBanishment(ip[, length[, comment[, admin]]]) doAddNamelock(name[, reason[, action[, comment[, admin]]]]) doAddBanishment(accId[, length[, reason[, action[, comment[, admin]]]]]) doAddDeletion(accId[, reason[, action[, comment[, admin]]]]]) doAddNotation(accId[, reason[, action[, comment[, admin]]]]]) doRemoveIpBanishment(ip[, mask]) doRemoveNamelock(name) doRemoveBanisment(accId) doRemoveDeletion(accId) doRemoveNotations(accId) doSaveServer() doReloadInfo() doCleanHouse(houseId) doCleanMap() doRefreshMap() 4. Funções #is isCreature(cid) isMonster(uid) isNpc(uid) isPlayer(cid) isPlayerPzLocked(cid) isItemStackable(itemid) isItemRune(itemid) isItemMovable(itemid) isItemDoor(itemid) isItemContainer(itemid) isItemFluidContainer(itemid) isContainer(uid) isCorpse(uid) isMovable(uid) isSightClear(fromPos, toPos, floorCheck) isIpBanished(ip[, mask]) isPlayerNamelocked(name) isAccountBanished(accId) isAccountDeleted(accId) isInArray({array}, value) 5. Outras funções registerCreatureEvent(uid, eventName) createCombatArea({area}[, {exArea}]) createConditionObject(type[, ticks[, buff[, subId]]]) addDamageCondition(condition, rounds, time, value) addOutfitCondition(condition, lookTypeEx, lookType, lookHead, lookBody, lookLegs, lookFeet) createCombatObject() numberToVariant(number) stringToVariant(string) positionToVariant(pos) targetPositionToVariant(pos) variantToNumber(var) variantToString(var) variantToPosition(var) canPlayerWearOutfit(cid, looktype, addons) executeRaid(name) addEvent(callback, delay, ...) stopEvent(eventid) hasProperty(uid) 6. Funções #db table db.executeQuery(query) db.storeQuery(query) db.escapeString(str) db.escapeBlob(s, length) db.stringComparisonOperator() 7. Funções #result table result.getDataInt(resId, s) result.getDataLong(resId, s) result.getDataString(resId, s) result.getDataStream(resId, s, length) result.next(resId) result.free(resId) 8. Funções #bit table #bit.cast bit.bnot(n) bit.band(type, n) bit.bor(type, n) bit.bxor(type, n) bit.lshift(type, n) bit.rshift(type, n) #bit.arshift #bit.ucast bit.ubnot(n) bit.uband(type, n) bit.ubor(type, n) bit.ubxor(type, n) bit.ulshift(type, n) bit.urshift(type, n) #bit.uarshift 9. Funções iguais table.getPos = table.find doSetCreatureDropLoot = doCreatureSetDropLoot doPlayerSay = doCreatureSay doPlayerAddMana = doCreatureAddMana playerLearnInstantSpell = doPlayerLearnInstantSpell doPlayerRemOutfit = doPlayerRemoveOutfit pay = doPlayerRemoveMoney broadcastMessage = doBroadcastMessage getPlayerName = getCreatureName getPlayerPosition = getCreaturePosition getCreaturePos = getCreaturePosition creatureGetPosition = getCreaturePosition getPlayerMana = getCreatureMana getPlayerMaxMana = getCreatureMaxMana hasCondition = getCreatureCondition isMoveable = isMovable isItemMoveable = isItemMovable saveData = saveServer savePlayers = saveServer getPlayerSkill = getPlayerSkillLevel getPlayerSkullType = getCreatureSkullType getAccountNumberByName = getAccountIdByName getIPByName = getIpByName getPlayersByIP = getPlayersByIp getThingfromPos = getThingFromPos getPlayersByAccountNumber = getPlayersByAccountId getIPByPlayerName = getIpByName getPlayersByIPNumber = getPlayersByIp getAccountNumberByPlayerName = getAccountIdByName convertIntToIP = doConvertIntegerToIp convertIPToInt = doConvertIpToInteger queryTileAddThing = doTileQueryAdd getTileHouseInfo = getHouseFromPos executeRaid = doExecuteRaid saveServer = doSaveServer cleanHouse = doCleanHouse cleanMap = doCleanMap shutdown = doShutdown mayNotMove = doCreatureSetNoMove doPlayerSetNoMove = doCreatureSetNoMove getPlayerNoMove = getCreatureNoMove getConfigInfo = getConfigValue 10. Funções #lua-made doPlayerGiveItem(cid, itemid, amount, subType) doPlayerTakeItem(cid, itemid, amount) doPlayerBuyItem(cid, itemid, count, cost, charges) doPlayerBuyItemContainer(cid, containerid, itemid, count, cost, charges) doPlayerSellItem(cid, itemid, count, cost) isInRange(pos, fromPos, toPos) isPremium(cid) getMonthDayEnding(day) getMonthString(m) getArticle(str) isNumber(str) getDistanceBetween(firstPosition, secondPosition) doPlayerAddAddons(cid, addon) isSorcerer(cid) isDruid(cid) isPaladin(cid) isKnight(cid) isRookie(cid) getDirectionTo(pos1, pos2) getPlayerLookPos(cid) getPosByDir(fromPosition, direction, size) getPlayerMoney(cid) doPlayerWithdrawAllMoney(cid) doPlayerDepositAllMoney(cid) doPlayerTransferAllMoneyTo(cid, target) playerExists(name) getTibiaTime() doWriteLogFile(file, text) isInArea(pos, fromPos, toPos) getExperienceForLevel(lv) doMutePlayer(cid, time) getPlayerVocationName(cid) getPromotedVocation(vid) doPlayerRemovePremiumDays(cid, days) getPlayerMasterPos(cid) getItemNameById(itemid) getItemPluralNameById(itemid) getItemArticleById(itemid) getItemName(uid) getItemPluralName(uid) getItemArticle(uid) getItemText(uid) getItemWriter(uid) getItemDate(uid) getTilePzInfo(pos) getTileZoneInfo(pos) debugPrint(text) doShutdown() doSummonCreature(name, pos) getOnlinePlayers() getPlayerByName(name) isPlayerGhost(cid) getPlayerFrags(cid) getPartyLeader(cid) isInParty(cid) isPrivateChannel(channelId) doConvertIntegerToIp(int, mask) doConvertIpToInteger(int, mask) getBooleanFromString(str) doCopyItem(item, attributes) exhaustion.check(cid, storage) exhaustion.get(cid, storage) exhaustion.set(cid, storage, time) exhaustion.make(cid, storage, time) table.find(table, value) table.isStrIn(txt, str) table.countElements(table, item) table.getCombinations(table, num) string.split(str) string.trim(str) string.explode(str, sep) OBS: 90% Créditos ao Sukx e 10% a mim por trazer ao TibiaKing e formatar o texto.
  7. thalia postou uma resposta no tópico em Playground (Off-topic)
    , HUAHUSHAHUS sou seu puto amigo XD . RIRIRA TB SO NOVO AQUI Boa sorte pra noi' B)
  8. Falae demonbholder (: Gostei da talkaction XD, borá twittar õ/ REP for you
  9. Nome: NPC Apostador Las Vegas Versão: Testada na 8.54, mais provavelmente funfa 8.5+ Créditos: 100% by me (: Como "fanuncia"? È um npc de apostar, ele possuiu "por inquanto" dois jogos 21 e Jogo dos 6. ~~> Explicando o 21 <~~ O 21 funciona assim: Você ira ganhar 1 número e o número tem quer ser 21, ou chegar o mais próximo possível sem ultrapassar esse valor. E a mesma coisa será feita com o npc, ele ganhará 1 número. Você pode ir comprando mais números dizendo [comprar] e se quiser parar é só dizer [parar]. Se seu número for maior que o do npc, você leva o triplo do dinheiro apostado. ~~> Explicando o Jogo do 6 <~~ O Jogo do 6 funciona assim: O npc vai rodar um dado, e se cair no número 6 você ganha o sêxtuplo (6 vezes) do valor apostado. Caso não caia no 6, você perde apenas o dinheiro da aposta. Legal né? Instalando o npc -> Vá até a pasta data/npc e crie um arquivo xml com o nome lasvegas.xml e cole esse codigo dentro: <?xml version="1.0" encoding="UTF-8"?> <npc name="Apostador" script="data/npc/scripts/apostador_la.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="138" head="96" body="95" legs="0" feet="95" addons="0"/> <parameters> <parameter key="message_greet" value="Como vai? |PLAYERNAME|, Quer {apostar} comigo?" /> <parameter key="module_keywords" value="1" /> </parameters> </npc> -> Vá até a pasta data/npc/scripts e crie um arquivo lua com o nome apostador_la.lua e cole esse codigo dentro: -- Preços das apostas -- price_21 = 1000 -- 1k ou 1000gold price_jogo6 = 5000 local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'apostar')) then selfSay('Eu faço 2 jogos: {21},{Jogo do 6} escolha um deles!', cid) talkState[talkUser] = 5 elseif (msgcontains(msg, 'Jogo do 6') and talkState[talkUser] == 5) then selfSay('O Jogo do 6 funciona assim: Eu vou rodar um dado, e se cair no número 6 você ganha o sêxtuplo (6 vezes) do valor apostado.', cid) selfSay('Caso não caia no 6, você perde apenas o dinheiro da aposta.', cid) selfSay('Está pronto para {começar}?.', cid) talkState[talkUser] = 3 elseif(msgcontains(msg, 'começar') and talkState[talkUser] == 3) then selfSay('Você possui o {dinheiro} da aposta ('..price_jogo6..')golds ?', cid) if doPlayerRemoveMoney(cid, price_jogo6) == TRUE then talkState[talkUser] = 2 else selfSay('Desculpe, mais você não tem dinheiro para apostar comigo.',cid) end elseif(msgcontains(msg, 'dinheiro') and talkState[talkUser] == 2) then sorteio6 = math.random(1,6) if sorteio6 == 6 then talkState[talkUser] = 3 selfSay('Parábens, o número sorteado foi 6 e você acaba de ganhar '..(price_jogo6*6) ..'golds, mais o dinheiro que você pagou da aposta.',cid) doPlayerAddMoney(cid,price_jogo6*6) else talkState[talkUser] = 2 selfSay('Que azar, o número sorteado foi '..sorteio6..', mais sorte na proxima.',cid) end elseif(msgcontains(msg, '21') and talkState[talkUser] == 5) then selfSay('O 21 funciona assim: Você ira ganhar 1 número e o número tem quer ser 21, ou chegar o mais próximo possível sem ultrapassar esse valor.', cid) selfSay('E a mesma coisa será feita comigo, ganharei 1 número.', cid) selfSay('Você pode ir comprando mais números dizendo [comprar] e se quiser parar é só dizer [parar].', cid) selfSay('Se você ganhar de mim, você leva o triplo do dinheiro apostado.', cid) selfSay('Está pronto para {começar}?.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'começar') and talkState[talkUser] == 0) then selfSay('Você possui o {dinheiro} da aposta ('..price_21..')golds ?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'dinheiro') and talkState[talkUser] == 1) then if doPlayerRemoveMoney(cid, price_21) == TRUE then talkState[talkUser] = 0 local mpn = math.random(1,21) setPlayerStorageValue(cid, 55411,mpn) local pn = getPlayerStorageValue(cid, 55411) selfSay('Seu número é '..pn..', quer comprar mais ou parar?',cid) else selfSay('Desculpe, mais você não tem dinheiro para apostar comigo.',cid) end elseif(msgcontains(msg, 'comprar') and talkState[talkUser] == 0) then local cp = math.random(1,10) setPlayerStorageValue(cid, 55411, (getPlayerStorageValue(cid, 55411))+cp) selfSay('Seu número é '..getPlayerStorageValue(cid, 55411)..', quer comprar mais ou parar?',cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'parar') and talkState[talkUser] == 0) then local npcn = math.random(15,21) setPlayerStorageValue(cid, 2224, npcn) if getPlayerStorageValue(cid, 55411) < getPlayerStorageValue(cid, 2224)then selfSay('Meu número é '..getPlayerStorageValue(cid, 2224)..'.',cid) selfSay('Seu número final é '..getPlayerStorageValue(cid, 55411)..'.',cid) selfSay('Ganhei, mais sorte na proxima vez.',cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, 55411) == getPlayerStorageValue(cid, 2224) then selfSay('Meu número é '..getPlayerStorageValue(cid, 2224)..'.',cid) selfSay('Seu número final é '..getPlayerStorageValue(cid, 55411)..'.',cid) selfSay('Empato, portanto ninguem ganha nada.',cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, 55411) > getPlayerStorageValue(cid, 2224) then selfSay('Meu número é '..getPlayerStorageValue(cid, 2224)..'.',cid) selfSay('Seu número final é '..getPlayerStorageValue(cid, 55411)..'.',cid) local somag = (price_21*3) selfSay('Você ganhou '..somag..'golds, mais os seus '..price_21..'golds de volta. Parábens !!!',cid) doPlayerAddMoney(cid, somag) doPlayerAddMoney(cid, price_21) talkState[talkUser] = 1 else selfSay('Desculpe, mais você não possui dinheiro está aposta',cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Pronto, npc instalado. Qualquer dúvida, tamo ae. Gostou? REP +
  10. thalia postou uma resposta no tópico em Playground (Off-topic)
    EAE Galera XD' Sou novo aqui (: Pra quem não me conhece. (creio que ngm), my name is lucas ou se prefirir darKHarpines, pra quem acessa o ********** meu nick lá é thalia' Sou scripter. sempre que eu puder ajudar estarei aqui!! È isso. VALEEUS

Informação Importante

Confirmação de Termo