-
-
-
[Help] Regarding Command Script (talkaction)
Thanks a lot! it made me realize how I could modify it to my taste! But unlucly it didnt worked as i tought In example now it goes like this With my now edited code (From Sergio R :D!) I do. !bless and it goes If not in fight then i get bless if with not enough money it goes blockhit if aready bought it it goes poff if in battle it goes drawblood (everything is fine there) ! But is there any possibility to make it so when I already bought the blessings with !bless then it no longer tries to get the other variables like drawblood if in fight ?( If player has blessings then no longer tries to ask for money, get fight condition etc.) Here is the code im using right now. function onSay(cid) local player = Player(cid) local totalBlessPrice = getBlessingsCost(player:getLevel()) * 5 * 0.7 if(not(getCreatureCondition(cid, CONDITION_INFIGHT))) then if player:getBlessings() == 5 then player:getPosition():sendMagicEffect(CONST_ME_POFF) player:sendCancelMessage("You already have been blessed!", cid) elseif player:removeMoney(totalBlessPrice) then player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!") for b = 1, 5 do player:addBlessing(b, 1) end else player:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT) player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.", cid) end else player:getPosition():sendMagicEffect(CONST_ME_DRAWBLOOD) player:sendCancelMessage("You can't buy bless while you have battle time left.") end end Thanks in advance man !
-
[TFS 1.x] Scripting Service
1.3 !fly command talkaction Something in which you could do !fly then a modal window opens up with the list of customatizable towns list and they custom position to appear. That would be really nice (dont know if it already exists tho ! Thanks and greetings from norway :D!
-
[Help] Regarding Command Script (talkaction)
@Sttorm Im going to check it out when im in my house later this day. I would post back with the news Thanks man
-
[Help] Regarding Command Script (talkaction)
@Sttorm Perfect!!! Thanks a lot!!!! It works now as i wanted. Awesome!!! Thanks! @Sttorm Also Could you help me with this ? I Would like This setup: -When Player cast command it says "You have been blessed by all of eight gods! and CONST_ME_HOLYAREA(and no other animation overwrite) -When Player cast the command if he already has blessings it goes "You already have been blessed and CONST_ME_POFF(and no other animation overwrite) -When Player cast the command If he was Condition_INFIGHT it says" You cant Buy Bless While you have battle time left and goes CONST_ME_DRAWBLOOD" (and no other animation overwrite) With the This setup I get: You have been blessed by all of eight gods! and CONST_ME_HOLYAREA + CONST_ME_POFF(I dont want the CONSTE_ME_POFF here,somehow in my setup it overwrites , it displays both at the same time) "You already have been blessed and CONST_ME_POFF You cant Buy Bless While you have battle time left And does CONST_ME_POFF" (Im not the author of this Script- I just Edited a little bit) Thanks in advance The setup: function onSay(cid) local player = Player(cid) local totalBlessPrice = getBlessingsCost(player:getLevel()) * 5 * 0.7 if(not(getCreatureCondition(cid, CONDITION_INFIGHT))) then if player:getBlessings() == 5 then player:sendCancelMessage("You already have been blessed!", cid) elseif player:removeMoney(totalBlessPrice) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!") for b = 1, 5 do player:addBlessing(b, 1) end player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA) else player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.", cid) end player:getPosition():sendMagicEffect(CONST_ME_POFF) else player:sendCancelMessage("You can't buy bless while you have battle time left.") end player:getPosition():sendMagicEffect(CONST_ME_POFF) end
-
-
Cassino / Casino / NPC / Bot
TFS 1.3 Base: Otx Malucoo newest Gitlab I would like to know how can I fix this in order to work on tfs 1.3 The bot works but doesnt answer you name instead it says PLAYERNAME, also it doesnt give you the money when you win. Thanks in advance 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 local function delayMoneyRemoval(item, pos) doRemoveItem(getTileItemById(pos, item).uid) return true end local function placeMoney(amount, table_middle_pos) local remain = amount local crystal_coins = 0 local platinum_coins = 0 if (math.floor(amount / 10000) >= 1) then crystal_coins = math.floor(amount / 10000) remain = remain - crystal_coins * 10000 end if ((remain / 100) >= 1) then platinum_coins = remain / 100 end addEvent(doCreateItem, 550, 2152, platinum_coins, table_middle_pos) addEvent(doCreateItem, 600, 2160, crystal_coins, table_middle_pos) end local function rollDice(roll, cc_count, pc_count, table_left_pos, table_middle_pos, npc) local dice_ids = {5792, 5793, 5794, 5795, 5796, 5797} local random_rollval = math.random(1,6) local total_g = (10000 * cc_count) + (100 * pc_count) local prize_percent = 0.8 -- 80% if ((total_g) <= 500000 and (total_g) >= 30000) then doSendMagicEffect(table_left_pos, CONST_ME_CRAPS) for _, itemId in pairs(dice_ids) do if(getTileItemById(table_left_pos, itemId).uid > 0) then doTransformItem(getTileItemById(table_left_pos, itemId).uid, dice_ids[random_rollval]) end end if (roll == 1 and random_rollval <= 3) then placeMoney(total_g + (total_g * prize_percent), table_middle_pos) addEvent(doSendMagicEffect, 400, table_left_pos, CONST_ME_SOUND_GREEN) addEvent(doSendMagicEffect, 700, table_left_pos, CONST_ME_SOUND_GREEN) addEvent(doCreatureSay, 500, npc, "Ganaste perro huehue!", TALKTYPE_SAY, false, 0) elseif (roll == 2 and random_rollval >= 4) then placeMoney(total_g + (total_g * prize_percent), table_middle_pos) addEvent(doSendMagicEffect, 400, table_left_pos, CONST_ME_SOUND_GREEN) addEvent(doSendMagicEffect, 700, table_left_pos, CONST_ME_SOUND_GREEN) addEvent(doCreatureSay, 500, npc, "Ganaste perro huehue!", TALKTYPE_SAY, false, 0) else addEvent(doSendMagicEffect, 400, table_left_pos, CONST_ME_BLOCKHIT) addEvent(doSendMagicEffect, 700, table_left_pos, CONST_ME_BLOCKHIT) addEvent(doCreatureSay, 500, npc, "Ahi pa la otra compare.", TALKTYPE_SAY, false, 0) end doCreatureSay(npc, string.format("%s rolled a %d.", getCreatureName(npc), random_rollval), TALKTYPE_ORANGE_1, false, 0, table_left_pos) else addEvent(doCreateItem, 100, 2160, cc_count, table_middle_pos) addEvent(doCreateItem, 150, 2152, pc_count, table_middle_pos) doCreatureSay(npc, "La minima apuesta es 30K y la maxima es 500K.", TALKTYPE_SAY, false, 0) end return true end function onThink() local cid = getNpcCid() local npc = Creature(cid) local npcpos = {x = 32159, y = 32296, z = 7} local creature = Tile(32159, 32298, 7):getTopCreature() if creature and creature:isPlayer() then selfTurn(SOUTH) --doCreatureSay(npc, "Que pedo |PLAYERNAME|, Haz girar tu suerte.", TALKTYPE_SAY, false, 0) else selfTurn(WEST) --doCreatureSay(npc, "Hasta la vixtaaa |PLAYERNAME|!.", TALKTYPE_SAY, false, 0) end if npc then local outfit = npc:getOutfit() outfit.lookHead = math.random(0, 132) outfit.lookBody = math.random(0, 132) outfit.lookLegs = math.random(0, 132) outfit.lookFeet = math.random(0, 132) npc:setOutfit(outfit) addEvent(doSendMagicEffect, 700, npcpos, CONST_ME_GIFT_WRAPS) end npcHandler:onThink() end function creatureSayCallback(cid, type, msg) -- NPC userdata instance local npc = getNpcCid() -- Game table position userdata instances local table_left_pos = {x = 32158, y = 32296, z = 7} -- Pos da frente do Npc onde gira o dado 32008, 31897, 7 local table_middle_pos = {x = 32158, y = 32297, z = 7} -- Pos do meio onde vai o dinheiro 32009, 31897, 7 -- Search for coins on the left and middle tables and create item userdata instances local table_middle_cc = getTileItemById(table_middle_pos, 2160) local table_middle_pc = getTileItemById(table_middle_pos, 2152) -- Other variables local cc_count = 0 local pc_count = 0 local ROLL, LOW, HIGH = 0, 1, 2 posplayer = {x = 32159, y = 32298, z = 7} -- Pos onde o player precisa estar 32010, 31898, 7 local ppos = getPlayerPosition(cid) if ppos.x == posplayer.x and ppos.y == posplayer.y then if isInArray({"H", "HIGH", "high", "h"}, msg) then ROLL = HIGH elseif isInArray({"L", "LOW", "l", "low"}, msg) then ROLL = LOW elseif isInArray({"roll", "game", "info", "play", "hi"}, msg) then doCreatureSay(npc, "Hola, {|PLAYERNAME|} quieres jugar roll the dice? low y high? Siendo Low=1,2,3 y High=4,5,6.", TALKTYPE_SAY, false, 0) else return false end if (table_middle_cc.uid ~= 0) then cc_count = table_middle_cc.type doTeleportThing(table_middle_cc.uid, table_left_pos) addEvent(delayMoneyRemoval, 300, 2160, table_left_pos) end if (table_middle_pc.uid ~= 0) then pc_count = table_middle_pc.type doTeleportThing(table_middle_pc.uid, table_left_pos) addEvent(delayMoneyRemoval, 300, 2152, table_left_pos) end addEvent(rollDice, 500, ROLL, cc_count, pc_count, table_left_pos, table_middle_pos, npc) else return false end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) --npcHandler:addModule(FocusModule:new()) Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
-
[Help] Regarding Command Script (talkaction)
Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website). Ex. TFS 1.3; Base: OTX Malucoo Latest Gitlab Qual erro está surgindo/O que você procura? Im trying to make a command (talkaction) that can´t be used while player is in combat,by monster,player or pzlocked(any combat) I already tried with if(not(isPlayerPzLocked(cid))) but that only works if the player haz pz(by pk-skull-or field) What lua configuration should i use in order to make it so cant be used while fighting Thanks in advance! Greetings from norway :D! Você tem o código disponível? Se tiver publique-o aqui: Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
-
Comando: !bless 1.3
@Cjaker I think I got it right this time! Could you tell me if this passed the test/aproved? function onSay(cid) local player = Player(cid) local totalBlessPrice = getBlessingsCost(player:getLevel()) * 5 * 0.7 if(not(isPlayerPzLocked(cid))) then if player:getBlessings() == 5 then player:sendCancelMessage("You already have been blessed!", cid) elseif player:removeMoney(totalBlessPrice) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!") for b = 1, 5 do player:addBlessing(b, 1) end player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA) else player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.", cid) end else player:sendCancelMessage("You can't buy bless while you are in a battle.") end end Ok its working as requested, but now if(not(isPlayerPzLocked(cid))) only does it so players CANT do it while having pz(pk) aka white skull... how can i change that so it also works with if(not(isPlayer"in any combat"(not only pk)(cid)))
-
-
-
Comando: !bless 1.3
Fala Galera!! Muito obrigado! no entanto, eles podem ser comprados na batalha, se o jogador pode comprar, como aquele que leva pz Disculpa mim malo portuguese! Cheers from Norway :D!! Hello everyone!!! well i have keep on testing it yet i can’t find a correct way to do the solution to the script in order that players can’t buy blessings while on battle! It would be awesome if someone could help us out! getCost(getPlayerLevel(cid)) if(not(isPlayerPzLocked(cid))) then player:sendCancelMessage("You can't buy bless, when you are in a battle.") end The community would be really thankfull!