• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Change outfit for 20 seconds SPELL

jajo776

New Member
Joined
Aug 27, 2015
Messages
40
Reaction score
2
Hi, could you edit my script.
When i used spell then my outfit have to be changed on LOOKTYPE 1214 for 20 seconds. After 20 seconds outfit changed for which was before
Engine 0.3.6
Thank you.
Lua:
local removeTime = 120 --time to remove the clones
local arr = {
    {
        {1, 0, 1},
        {1, 2, 1},
        {1, 0, 1}
    },
 
    {
        {1, 1, 0, 1, 1},
        {1, 0, 1, 0, 1},
        {0, 1, 2, 1, 0},
        {1, 0, 1, 0, 1},
        {1, 1, 0, 1, 1}
    }
}
 
function onTargetTile(cid, pos)
local creature = doSummonCreature("Powerfull Ghost Kamikaze", pos)
    doConvinceCreature(cid, creature)
    doChangeSpeed(creature, getCreatureBaseSpeed(cid))
    addEvent(removeCreatures, removeTime * 1000, cid, creature)
    return TRUE
end
 
local combat = {}
for i = 1, 2 do
    combat[i] = createCombatObject()
    setCombatParam(combat[i], COMBAT_PARAM_EFFECT, CONST_ME_POFF)
    setCombatArea(combat[i], createCombatArea(arr[i]))
    _G["onTargetTile" .. i] = onTargetTile
    setCombatCallback(combat[i], CALLBACK_PARAM_TARGETTILE, "onTargetTile" .. i)
end
 
function onCastSpell(cid, var)
  local config = {
       storage = 11114,
       cooldown = 1
   }
    if(os.time() - getPlayerStorageValue(cid, config.storage)) < config.cooldown then
       doPlayerSendCancel(cid, "You can use it just one time every 4 minutes.")
       doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
       return false
   end
       setPlayerStorageValue(cid, config.storage, os.time())
    return doCombat(cid, combat[1], var)
end
 
doSetCreatureOutfit(cid, 1214, 20)
Lua:
local removeTime = 120 --time to remove the clones
local arr = {
    {
        {1, 0, 1},
        {1, 2, 1},
        {1, 0, 1}
    },
    
    {
        {1, 1, 0, 1, 1},
        {1, 0, 1, 0, 1},
        {0, 1, 2, 1, 0},
        {1, 0, 1, 0, 1},
        {1, 1, 0, 1, 1}
    }
}
 
function onTargetTile(cid, pos)
    local creature = doSummonCreature("Powerfull Ghost Kamikaze", pos)
    doConvinceCreature(cid, creature)
    doChangeSpeed(creature, getCreatureBaseSpeed(cid))
    addEvent(removeCreatures, removeTime * 1000, cid, creature)
    return TRUE
end
 
local combat = {}
for i = 1, 2 do
    combat[i] = createCombatObject()
    setCombatParam(combat[i], COMBAT_PARAM_EFFECT, CONST_ME_POFF)
    setCombatArea(combat[i], createCombatArea(arr[i]))
    _G["onTargetTile" .. i] = onTargetTile
    setCombatCallback(combat[i], CALLBACK_PARAM_TARGETTILE, "onTargetTile" .. i)
end
 
function onCastSpell(cid, var)
    local config = {
        storage = 11114,
        cooldown = 1
    }
    if(os.time() - getPlayerStorageValue(cid, config.storage)) < config.cooldown then
        doPlayerSendCancel(cid, "You can use it just one time every 4 minutes.")
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        return false
    end
    doSetCreatureOutfit(cid, 1214, 20)
    setPlayerStorageValue(cid, config.storage, os.time())
    return doCombat(cid, combat[1], var)
end
 
doSetCreatureOutfit(cid, 1214, 20)
Lua:
local removeTime = 120 --time to remove the clones
local arr = {
    {
        {1, 0, 1},
        {1, 2, 1},
        {1, 0, 1}
    },
   
    {
        {1, 1, 0, 1, 1},
        {1, 0, 1, 0, 1},
        {0, 1, 2, 1, 0},
        {1, 0, 1, 0, 1},
        {1, 1, 0, 1, 1}
    }
}
 
function onTargetTile(cid, pos)
    local creature = doSummonCreature("Powerfull Ghost Kamikaze", pos)
    doConvinceCreature(cid, creature)
    doChangeSpeed(creature, getCreatureBaseSpeed(cid))
    addEvent(removeCreatures, removeTime * 1000, cid, creature)
    return TRUE
end
 
local combat = {}
for i = 1, 2 do
    combat[i] = createCombatObject()
    setCombatParam(combat[i], COMBAT_PARAM_EFFECT, CONST_ME_POFF)
    setCombatArea(combat[i], createCombatArea(arr[i]))
    _G["onTargetTile" .. i] = onTargetTile
    setCombatCallback(combat[i], CALLBACK_PARAM_TARGETTILE, "onTargetTile" .. i)
end
 
function onCastSpell(cid, var)
    local config = {
        storage = 11114,
        cooldown = 1
    }
    if(os.time() - getPlayerStorageValue(cid, config.storage)) < config.cooldown then
        doPlayerSendCancel(cid, "You can use it just one time every 4 minutes.")
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        return false
    end
    doSetCreatureOutfit(cid, 1214, 20)
    setPlayerStorageValue(cid, config.storage, os.time())
    return doCombat(cid, combat[1], var)
end
Thanks for answer but it doesnt work now spell is not even working :/
 
Console is not showing any error
Alright, just for fun, let's try the most simple spell possible.

Lua:
function onCastSpell(cid, var)
    print("Spell has been cast!")
    doSetCreatureOutfit(cid, 1214, 20)
    return true
end
 
Alright, just for fun, let's try the most simple spell possible.

Lua:
function onCastSpell(cid, var)
    print("Spell has been cast!")
    doSetCreatureOutfit(cid, 1214, 20)
    return true
end
Still nothing
Post automatically merged:

Still nothing
Alright, just for fun, let's try the most simple spell possible.

Lua:
function onCastSpell(cid, var)
    print("Spell has been cast!")
    doSetCreatureOutfit(cid, 1214, 20)
    return true
end
Even with return to combat is not working
Lua:
function onCastSpell(cid, var)
    print("Spell has been cast!")
    doSetCreatureOutfit(cid, 1214, 20)
    return doCombat(cid, combat[1], var)
    return true
end
Post automatically merged:

Alright, just for fun, let's try the most simple spell possible.

Lua:
function onCastSpell(cid, var)
    print("Spell has been cast!")
    doSetCreatureOutfit(cid, 1214, 20)
    return true
end
<instant name="XXX!" words="XXX" lvl="XX" maglv="100" mana="8000" prem="0" blockwalls="1" exhaustion="1500" needlearn="0" event="script" value="attack/XXX.lua">

Thats my spells.xml
 
Last edited:
Back
Top