boa tarde galera,to querendo testar 2 codigos que postaram a alguns anos atrás,mais sou iniciante e não sei onde add eles,to na duvida se é na source ou no server?
os codigos são estes
local shinycard = {[0] = {"Dragon", "Dragon lord", "Cyclops"},[1] = {"Rabbit, orc"},time = 60,id = 18315}local amulets = {[18313] = {"Entei"}, [18314] = {"Mewtwo"}, [18312] = {"Suicune"}, } h_storageClan, h_storageCD, h_storageCDValue, h_storageHelperTime = 181484, 181485, 24, 181486 function onUse(cid, item, fromPosition, itemEx, toPosition)local pos, a = getCreaturePosition(cid), 1 local pos_summon = {{x = pos.x + a, y = pos.y, z = pos.z}, {x = pos.x + a, y = pos.y + a, z = pos.z}, {x = pos.x, y = pos.y + a, z = pos.z}, {x = pos.x - a, y = pos.y + a, z = pos.z}, {x = pos.x - a, y = pos.y, z = pos.z}, {x = pos.x - a, y = pos.y - a, z = pos.z}, {x = pos.x, y = pos.y - a, z = pos.z}, {x = pos.x + a, y = pos.y - a, z = pos.z}, {x = pos.x +a, y = pos.y, z = pos.z}} hname = "" if getPlayerStorageValue(cid, h_storageCD) >= os.time() then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Resta ".. getPlayerStorageValue(cid, h_storageCD) - os.time() .." segundos de cooldown para utilizar esse item. ") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doRemoveCreature(getCreatureSummons(cid)[table.maxn(getCreatureSummons(cid))]) return true else if item.itemid == shinycard.id then hname = shinycard[getPlayerStorageValue(cid, h_storageClan)][math.random(#shinycard[getPlayerStorageValue(cid, h_storageClan)])] print (hname) end if (amulets[item.itemid]) then hname = amulets[item.itemid][1] end local helper = doCreateMonster(hname, pos_summon[math.random(9)]) local h_s = {} doConvinceCreature(cid, helper) -- registerCreatureEvent(helper, "HelpingCard") setPlayerStorageValue(helper, h_storageHelperTime, os.time() + 20) function Check(cid) if cid == true or isCreature(cid) then if getPlayerStorageValue(cid, h_storageHelperTime) <= os.time() then doRemoveCreature(cid) print"criatura removida" return true end else print"thing not found" return true end doSendAnimatedText(getThingPos(cid), getPlayerStorageValue(cid, h_storageHelperTime) - os.time() , 34) addEvent(Check, 1000, cid) if getCreatureTarget(cid) == 0 then local master = cid local centerPos = {x = getCreaturePosition(master).x + 1, y = getCreaturePosition(master).y, z = getCreaturePosition(master).z} local spec = getSpectators(centerPos, 8, 7, false) local random = spec[math.random(#spec)] s = random if not isPlayer(s) and not isSummon(s) and not isNpc(s) then helperEntei_1 (cid, s) print("possivel target:" .. getCreatureName(s)) local dest = getDirectionTo(getThingPos(cid), getThingPos(s)) if isWalkable(getPosByDir(getThingPos(cid), dest)) then local d = 1 while d < 2 do addEvent(doMoveCreature, 500,cid, dest) addEvent(doCreatureSetLookDir, 350, cid, getDirectionTo(getThingPos(cid), getThingPos(s))) d = d + 1 end doCreatureSetLookDir(cid, getDirectionTo(getThingPos(cid), getThingPos(s))) else print('not walkable') end end end hname = "" dest = "" end -- Check(helper) -- registerCreatureEvent(cid, "HelpingCard") setPlayerStorageValue(cid, h_storageCD, os.time() + 10) end return true end
helper_config = {["Entei"] = {minDamage = 5, maxDamage = 30, rangeAttack = 0},["Suicune"] = {min = 200, 500},["Raikou"] = {min = 200, max = 500}} function helperEntei_1 (cid, target) -- fire balllocal pos, a = getCreaturePosition(target), 1 pos_target = {{x = pos.x + a, y = pos.y, z = pos.z}, {x = pos.x + a, y = pos.y + a, z = pos.z}, {x = pos.x, y = pos.y + a, z = pos.z}, {x = pos.x - a, y = pos.y + a, z = pos.z}, {x = pos.x - a, y = pos.y, z = pos.z}, {x = pos.x - a, y = pos.y - a, z = pos.z}, {x = pos.x, y = pos.y - a, z = pos.z}, {x = pos.x + a, y = pos.y - a, z = pos.z}, {x = pos.x +a, y = pos.y, z = pos.z}} for i = 1, #pos_target do doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, pos_target[i], 1, - helper_config["Entei"].minDamage, - helper_config["Entei"].maxDamage, 6) end return true end
Pergunta
rafaelzera 0
boa tarde galera,to querendo testar 2 codigos que postaram a alguns anos atrás,mais sou iniciante e não sei onde add eles,to na duvida se é na source ou no server?
os codigos são estes
local shinycard = {[0] = {"Dragon", "Dragon lord", "Cyclops"},[1] = {"Rabbit, orc"},time = 60,id = 18315}local amulets = {[18313] = {"Entei"}, [18314] = {"Mewtwo"}, [18312] = {"Suicune"}, } h_storageClan, h_storageCD, h_storageCDValue, h_storageHelperTime = 181484, 181485, 24, 181486 function onUse(cid, item, fromPosition, itemEx, toPosition)local pos, a = getCreaturePosition(cid), 1 local pos_summon = {{x = pos.x + a, y = pos.y, z = pos.z}, {x = pos.x + a, y = pos.y + a, z = pos.z}, {x = pos.x, y = pos.y + a, z = pos.z}, {x = pos.x - a, y = pos.y + a, z = pos.z}, {x = pos.x - a, y = pos.y, z = pos.z}, {x = pos.x - a, y = pos.y - a, z = pos.z}, {x = pos.x, y = pos.y - a, z = pos.z}, {x = pos.x + a, y = pos.y - a, z = pos.z}, {x = pos.x +a, y = pos.y, z = pos.z}} hname = "" if getPlayerStorageValue(cid, h_storageCD) >= os.time() then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Resta ".. getPlayerStorageValue(cid, h_storageCD) - os.time() .." segundos de cooldown para utilizar esse item. ") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doRemoveCreature(getCreatureSummons(cid)[table.maxn(getCreatureSummons(cid))]) return true else if item.itemid == shinycard.id then hname = shinycard[getPlayerStorageValue(cid, h_storageClan)][math.random(#shinycard[getPlayerStorageValue(cid, h_storageClan)])] print (hname) end if (amulets[item.itemid]) then hname = amulets[item.itemid][1] end local helper = doCreateMonster(hname, pos_summon[math.random(9)]) local h_s = {} doConvinceCreature(cid, helper) -- registerCreatureEvent(helper, "HelpingCard") setPlayerStorageValue(helper, h_storageHelperTime, os.time() + 20) function Check(cid) if cid == true or isCreature(cid) then if getPlayerStorageValue(cid, h_storageHelperTime) <= os.time() then doRemoveCreature(cid) print"criatura removida" return true end else print"thing not found" return true end doSendAnimatedText(getThingPos(cid), getPlayerStorageValue(cid, h_storageHelperTime) - os.time() , 34) addEvent(Check, 1000, cid) if getCreatureTarget(cid) == 0 then local master = cid local centerPos = {x = getCreaturePosition(master).x + 1, y = getCreaturePosition(master).y, z = getCreaturePosition(master).z} local spec = getSpectators(centerPos, 8, 7, false) local random = spec[math.random(#spec)] s = random if not isPlayer(s) and not isSummon(s) and not isNpc(s) then helperEntei_1 (cid, s) print("possivel target:" .. getCreatureName(s)) local dest = getDirectionTo(getThingPos(cid), getThingPos(s)) if isWalkable(getPosByDir(getThingPos(cid), dest)) then local d = 1 while d < 2 do addEvent(doMoveCreature, 500,cid, dest) addEvent(doCreatureSetLookDir, 350, cid, getDirectionTo(getThingPos(cid), getThingPos(s))) d = d + 1 end doCreatureSetLookDir(cid, getDirectionTo(getThingPos(cid), getThingPos(s))) else print('not walkable') end end end hname = "" dest = "" end -- Check(helper) -- registerCreatureEvent(cid, "HelpingCard") setPlayerStorageValue(cid, h_storageCD, os.time() + 10) end return true end
helper_config = {["Entei"] = {minDamage = 5, maxDamage = 30, rangeAttack = 0},["Suicune"] = {min = 200, 500},["Raikou"] = {min = 200, max = 500}} function helperEntei_1 (cid, target) -- fire balllocal pos, a = getCreaturePosition(target), 1 pos_target = {{x = pos.x + a, y = pos.y, z = pos.z}, {x = pos.x + a, y = pos.y + a, z = pos.z}, {x = pos.x, y = pos.y + a, z = pos.z}, {x = pos.x - a, y = pos.y + a, z = pos.z}, {x = pos.x - a, y = pos.y, z = pos.z}, {x = pos.x - a, y = pos.y - a, z = pos.z}, {x = pos.x, y = pos.y - a, z = pos.z}, {x = pos.x + a, y = pos.y - a, z = pos.z}, {x = pos.x +a, y = pos.y, z = pos.z}} for i = 1, #pos_target do doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, pos_target[i], 1, - helper_config["Entei"].minDamage, - helper_config["Entei"].maxDamage, 6) end return true end
créditos ao Nogard por disponibilizar os codigos.
Editado por rafaelzeraLink para o comentário
Compartilhar em outros sites
9 respostass a esta questão
Posts Recomendados