yohanaugusto
New Member
- Joined
- Sep 28, 2008
- Messages
- 73
- Reaction score
- 0
I've made this script:
But it's not working, I've tried several times. I had this script before, but i lost it when I changed computer.
The erro is: "Attempt to index local 'creature' (a nil value)
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL)
local area = createCombatArea(AREA_CIRCLE3X3)
combat:setArea(area)
function onGetFormulaValues(player, level, maglevel)
min = -1000
max = -5000
return min, max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCreatureSay(cid, speak, talktype, text)
local MonsterText= "msg to active spell"
if (text == MonsterText) then
addEvent(useSpell, 4000)
end
end
function useSpell(cid)
local creature = Creature(cid)
if getCreatureTarget(cid) ~= 0 then
doCreatureSay(cid, "Using Spell", TALKTYPE_ORANGE_2)
return combat:execute(creature:getPosition(creature:getTarget(cid)))
end
end
But it's not working, I've tried several times. I had this script before, but i lost it when I changed computer.
The erro is: "Attempt to index local 'creature' (a nil value)