Postado Maio 10, 2015 10 anos local ar1 = createCombatArea{ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } local freeze = createConditionObject(CONDITION_FREEZING) setConditionParam(freeze, CONDITION_PARAM_TICKS, 10000) setConditionFormula(freeze, -0.5, 0, -0.5, 0) local burning = createConditionObject(CONDITION_FIRE) setConditionParam(burning, CONDITION_PARAM_TICKS, 10000) setConditionFormula(burning, -0.5, 0, -0.5, 0) local poison = createConditionObject(CONDITION_POISON) setConditionParam(poison, CONDITION_PARAM_TICKS, 10000) setConditionFormula(poison, -0.5, 0, -0.5, 0) local confusion = createConditionObject(CONDITION_PHYSICAL) setConditionParam(confusion, CONDITION_PARAM_TICKS, 10000) setConditionFormula(confusion, -0.5, 0, -0.5, 0) local paralyze = createConditionObject(CONDITION_PARALYZE) setConditionParam(paralyze, CONDITION_PARAM_TICKS, 10000) setConditionFormula(paralyze, -0.5, 0, -0.5, 0) local condition = { [11400] = {burning}, [11399] = {paralyze}, [11398] = {confusion}, [11397] = {poison}, [11396] = {freeze}, [11395] = {burning}, } function doPlayerShootBazooka(cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds) if rounds == nil then rounds = 1 end exhaustion.set(cid, 57193, exhaust) if getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == true then local cond = doAddCondition[(cid, condition).itemid] doSendDistanceShoot(getCreaturePosition(cid), getThingPos(target), dist_effect, cond) doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, getThingPos(target), area, -min, -max, effect) if rounds == times then return true end addEvent(doPlayerShootBazooka, shots_delay, cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds+1) end function onUse(cid, item, fromPosition, itemEx, toPosition) local weapons = { -- [iD da arma] = {tiros, delay_dos_tiros, ammo, area, dano_min, dano_max, efeito, distance_effect, exhaustion}, [2447] = { shots = 1, shots_delay = 50, area = ar1, exha = 5, ammo = { --Configure aqui as munições da arma. [11400] = {min = 25600, max = 35720, effect = 15, dist_effect = 8}, [11399] = {min = 25600, max = 35720, effect = 48, dist_effect = 8}, [11398] = {min = 25600, max = 35720, effect = 51, dist_effect = 8}, [11397] = {min = 25600, max = 35720, effect = 43, dist_effect = 8}, [11396] = {min = 25600, max = 35720, effect = 7, dist_effect = 8}, [11395] = {min = 25600, max = 35720, effect = 20, dist_effect = 8}, }, }, } local gun = weapons[item.itemid] if gun then if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid ~= item.itemid then doPlayerSendCancel(cid, "O lançador deve estar equipado no slot da arma.") return true elseif getPlayerStorageValue(cid, 18391) == 1 then doPlayerSendCancel(cid, "Você não pode atirar enquanto dirige.") return true elseif getPlayerStorageValue(cid, 18393) == 1 then doPlayerSendCancel(cid, "Você não pode atirar com o capacete.") return true elseif exhaustion.check(cid, 57193) then doPlayerSendCancel(cid, "Você está exausto.") return true elseif getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid < 1 then return doPlayerSendCancel(cid, "A munição deve estar equipada no slot da munição.") elseif not gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid] then return doPlayerSendCancel(cid, "Wrong ammo for this gun.") elseif getPlayerItemCount(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid) < gun.shots then doPlayerSendCancel(cid, "Você não possui munição.") return true end local ammo = gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid] doPlayerRemoveItem(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid, gun.shots) doPlayerShootBazooka(cid, itemEx.uid, gun.shots, gun.shots_delay, gun.area, ammo.min, ammo.max, ammo.effect, ammo.dist_effect, gun.exha) end end return true end tente assim acho que agora vai Ando devagar, porque já tive pressa. E levo esse sorriso, porque já chorei demais... ________________________________________________________________________________ Minhas Sprites: Mega Metagross Mega Abomasnow Pack de Shinys [Posso atualizá-lo com novos shinys a qualquer momento] Tutoriais: [Completo] Criando e adicionando um novo Pokémon [Actions] Criando quest no RME Editores Lua/Xml/Sync Entre outros: Editores Win/Mac/Linux
Postado Maio 10, 2015 10 anos Autor Atualmente, esse erro [10/05/2015 15:50:44] [Error - LuaScriptInterface::loadFile] data/actions/scripts/launchergrenade.lua:47: ')' expected near ',' [10/05/2015 15:50:44] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/launchergrenade.lua) [10/05/2015 15:50:44] data/actions/scripts/launchergrenade.lua:47: ')' expected near ',' [10/05/2015 15:50:44] Reloaded actions. Editado Maio 10, 2015 10 anos por biel.stocco (veja o histórico de edições)
Postado Maio 10, 2015 10 anos tente: local ar1 = createCombatArea{ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } local freeze = createConditionObject(CONDITION_FREEZING) setConditionParam(freeze, CONDITION_PARAM_TICKS, 10000) setConditionFormula(freeze, -0.5, 0, -0.5, 0) local burning = createConditionObject(CONDITION_FIRE) setConditionParam(burning, CONDITION_PARAM_TICKS, 10000) setConditionFormula(burning, -0.5, 0, -0.5, 0) local poison = createConditionObject(CONDITION_POISON) setConditionParam(poison, CONDITION_PARAM_TICKS, 10000) setConditionFormula(poison, -0.5, 0, -0.5, 0) local confusion = createConditionObject(CONDITION_PHYSICAL) setConditionParam(confusion, CONDITION_PARAM_TICKS, 10000) setConditionFormula(confusion, -0.5, 0, -0.5, 0) local paralyze = createConditionObject(CONDITION_PARALYZE) setConditionParam(paralyze, CONDITION_PARAM_TICKS, 10000) setConditionFormula(paralyze, -0.5, 0, -0.5, 0) local condition = { [11400] = {burning}, [11399] = {paralyze}, [11398] = {confusion}, [11397] = {poison}, [11396] = {freeze}, [11395] = {burning}, } function doPlayerShootBazooka(cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds) if rounds == nil then rounds = 1 end exhaustion.set(cid, 57193, exhaust) if getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == true then local cond = doAddCondition[(condition).itemid] doSendDistanceShoot(getCreaturePosition(cid), getThingPos(target), dist_effect, cond) doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, getThingPos(target), area, -min, -max, effect) if rounds == times then return true end addEvent(doPlayerShootBazooka, shots_delay, cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds+1) end function onUse(cid, item, fromPosition, itemEx, toPosition) local weapons = { -- [iD da arma] = {tiros, delay_dos_tiros, ammo, area, dano_min, dano_max, efeito, distance_effect, exhaustion}, [2447] = { shots = 1, shots_delay = 50, area = ar1, exha = 5, ammo = { --Configure aqui as munições da arma. [11400] = {min = 25600, max = 35720, effect = 15, dist_effect = 8}, [11399] = {min = 25600, max = 35720, effect = 48, dist_effect = 8}, [11398] = {min = 25600, max = 35720, effect = 51, dist_effect = 8}, [11397] = {min = 25600, max = 35720, effect = 43, dist_effect = 8}, [11396] = {min = 25600, max = 35720, effect = 7, dist_effect = 8}, [11395] = {min = 25600, max = 35720, effect = 20, dist_effect = 8}, }, }, } local gun = weapons[item.itemid] if gun then if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid ~= item.itemid then doPlayerSendCancel(cid, "O lançador deve estar equipado no slot da arma.") return true elseif getPlayerStorageValue(cid, 18391) == 1 then doPlayerSendCancel(cid, "Você não pode atirar enquanto dirige.") return true elseif getPlayerStorageValue(cid, 18393) == 1 then doPlayerSendCancel(cid, "Você não pode atirar com o capacete.") return true elseif exhaustion.check(cid, 57193) then doPlayerSendCancel(cid, "Você está exausto.") return true elseif getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid < 1 then return doPlayerSendCancel(cid, "A munição deve estar equipada no slot da munição.") elseif not gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid] then return doPlayerSendCancel(cid, "Wrong ammo for this gun.") elseif getPlayerItemCount(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid) < gun.shots then doPlayerSendCancel(cid, "Você não possui munição.") return true end local ammo = gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid] doPlayerRemoveItem(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid, gun.shots) doPlayerShootBazooka(cid, itemEx.uid, gun.shots, gun.shots_delay, gun.area, ammo.min, ammo.max, ammo.effect, ammo.dist_effect, gun.exha) end end return true end Ando devagar, porque já tive pressa. E levo esse sorriso, porque já chorei demais... ________________________________________________________________________________ Minhas Sprites: Mega Metagross Mega Abomasnow Pack de Shinys [Posso atualizá-lo com novos shinys a qualquer momento] Tutoriais: [Completo] Criando e adicionando um novo Pokémon [Actions] Criando quest no RME Editores Lua/Xml/Sync Entre outros: Editores Win/Mac/Linux
Postado Maio 10, 2015 10 anos Autor Erro [10/05/2015 15:58:31] [Error - Action Interface] [10/05/2015 15:58:31] data/actions/scripts/launchergrenade.lua [10/05/2015 15:58:31] Description: [10/05/2015 15:58:31] (luaSetConditionFormula) Condition not found [10/05/2015 15:58:31] [Error - Action Interface] [10/05/2015 15:58:31] data/actions/scripts/launchergrenade.lua [10/05/2015 15:58:31] Description: [10/05/2015 15:58:31] (luaSetConditionFormula) Condition not found [10/05/2015 15:58:31] [Error - Action Interface] [10/05/2015 15:58:31] data/actions/scripts/launchergrenade.lua [10/05/2015 15:58:31] Description: [10/05/2015 15:58:31] (luaSetConditionFormula) Condition not found [10/05/2015 15:58:31] [Error - Action Interface] [10/05/2015 15:58:31] data/actions/scripts/launchergrenade.lua [10/05/2015 15:58:31] Description: [10/05/2015 15:58:31] (luaSetConditionFormula) Condition not found [10/05/2015 15:58:31] [Warning - Event::loadScript] Event onUse not found (data/actions/scripts/launchergrenade.lua) [10/05/2015 15:58:31] Reloaded actions. será que não teria que fazer o condition em outro arquivo separado? tipo, carregar um arquivo em action que adiciona condition aos itens 11395 ao 11400 e o outro que seria o lançador, que já usaria o código atual? <action itemid="2447" script="launchergrenade.lua"/> <action itemid="11395; 11396; 11397; 11398; 11399; 11400" script="ammocondition.lua"/> Editado Maio 10, 2015 10 anos por biel.stocco (veja o histórico de edições)
Postado Maio 10, 2015 10 anos Ta muito complicado adicionar a condition ... tente esse: local ar1 = createCombatArea{ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},{0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},} function doPlayerShootBazooka(cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds) if condition[item.itemid] == getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid then local cond = condition[item.itemid] local condition = { [11400] = {burning}, [11399] = {paralyze}, [11398] = {confusion}, [11397] = {poison}, [11396] = {freeze}, [11395] = {burning}, } local freeze = createConditionObject(CONDITION_FREEZING) setConditionParam(freeze, CONDITION_PARAM_TICKS, 10000) setConditionFormula(freeze, -0.5, 0, -0.5, 0) local burning = createConditionObject(CONDITION_FIRE) setConditionParam(burning, CONDITION_PARAM_TICKS, 10000) setConditionFormula(burning, -0.5, 0, -0.5, 0) local poison = createConditionObject(CONDITION_POISON) setConditionParam(poison, CONDITION_PARAM_TICKS, 10000) setConditionFormula(poison, -0.5, 0, -0.5, 0) local confusion = createConditionObject(CONDITION_PHYSICAL) setConditionParam(confusion, CONDITION_PARAM_TICKS, 10000) setConditionFormula(confusion, -0.5, 0, -0.5, 0) local paralyze = createConditionObject(CONDITION_PARALYZE) setConditionParam(paralyze, CONDITION_PARAM_TICKS, 10000) setConditionFormula(paralyze, -0.5, 0, -0.5, 0) if rounds == nil then rounds = 1 end exhaustion.set(cid, 57193, exhaust) doSendDistanceShoot(getCreaturePosition(cid), getThingPos(target), dist_effect, cond) doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, getThingPos(target), area, -min, -max, effect) if rounds == times then return true end addEvent(doPlayerShootBazooka, shots_delay, cid, target, times, delay, area, min, max, effect, dist_effect, exhaust, rounds+1) end end function onUse(cid, item, fromPosition, itemEx, toPosition) local weapons = { -- [ID da arma] = {tiros, delay_dos_tiros, ammo, area, dano_min, dano_max, efeito, distance_effect, exhaustion}, [2447] = { shots = 1, shots_delay = 50, area = ar1, exha = 5, ammo = { --Configure aqui as munições da arma. [11400] = {min = 25600, max = 35720, effect = 15, dist_effect = 8}, [11399] = {min = 25600, max = 35720, effect = 48, dist_effect = 8}, [11398] = {min = 25600, max = 35720, effect = 51, dist_effect = 8}, [11397] = {min = 25600, max = 35720, effect = 43, dist_effect = 8}, [11396] = {min = 25600, max = 35720, effect = 7, dist_effect = 8}, [11395] = {min = 25600, max = 35720, effect = 20, dist_effect = 8}, }, }, } local gun = weapons[item.itemid] if gun then if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid ~= item.itemid then doPlayerSendCancel(cid, "O lançador deve estar equipado no slot da arma.") return true elseif getPlayerStorageValue(cid, 18391) == 1 then doPlayerSendCancel(cid, "Você não pode atirar enquanto dirige.") return true elseif getPlayerStorageValue(cid, 18393) == 1 then doPlayerSendCancel(cid, "Você não pode atirar com o capacete.") return true elseif exhaustion.check(cid, 57193) then doPlayerSendCancel(cid, "Você está exausto.") return true elseif getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid < 1 then return doPlayerSendCancel(cid, "A munição deve estar equipada no slot da munição.") elseif not gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid] then return doPlayerSendCancel(cid, "Wrong ammo for this gun.") elseif getPlayerItemCount(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid) < gun.shots then doPlayerSendCancel(cid, "Você não possui munição.") return true end local ammo = gun.ammo[getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid] doPlayerRemoveItem(cid, getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid, gun.shots) doPlayerShootBazooka(cid, itemEx.uid, gun.shots, gun.shots_delay, gun.area, ammo.min, ammo.max, ammo.effect, ammo.dist_effect, gun.exha) end return trueend Ando devagar, porque já tive pressa. E levo esse sorriso, porque já chorei demais... ________________________________________________________________________________ Minhas Sprites: Mega Metagross Mega Abomasnow Pack de Shinys [Posso atualizá-lo com novos shinys a qualquer momento] Tutoriais: [Completo] Criando e adicionando um novo Pokémon [Actions] Criando quest no RME Editores Lua/Xml/Sync Entre outros: Editores Win/Mac/Linux
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.