local EFFECTS = {
--[OutfitID] = {Effect}
[159] = {23}
}
function onThink(cid, interval)
if not isPlayer(cid) then
return true
end
local effect = EFFECTS[getCreatureOutfit(cid).lookType]
if effect then
addEvent(effectSender, interval, {cid=cid, pos=getCreaturePos(cid), effect=effect[1]})
end
return true
end
function effectSender(p)
local newPos = getCreaturePos(p.cid)
if newPos.x ~= p.pos.x or newPos.y ~= p.pos.y then
doSendMagicEffect(p.pos, p.effect)
end
end
[19/02/2011 04:29:02] [Error - CreatureScript Interface]
[19/02/2011 04:29:02] In a timer event called from:
[19/02/2011 04:29:02] data/creaturescripts/scripts/caminar.luanThink
[19/02/2011 04:29:02] Description:
[19/02/2011 04:29:02] (luaGetThingPosition) Thing not found
[19/02/2011 04:29:02] [Error - CreatureScript Interface]
[19/02/2011 04:29:02] In a timer event called from:
[19/02/2011 04:29:02] data/creaturescripts/scripts/caminar.luanThink
[19/02/2011 04:29:02] Description:
[19/02/2011 04:29:02] data/creaturescripts/scripts/caminar.lua:18: attempt to index local 'newPos' (a boolean value)
[19/02/2011 04:29:02] stack traceback:
[19/02/2011 04:29:02] data/creaturescripts/scripts/caminar.lua:18: in function <data/creaturescripts/scripts/caminar.lua:16>
function onThink(cid, interval)
local config = {
[159] = 23,
[129] = 24
}
local outfit = config[getCreatureOutfit(cid).lookType]
if outfit then
doSendMagicEffect(getCreaturePosition(cid), outfit)
end
return true
end
local time = 2 --Second syntax (Default: 2)
local EFFECTS = {
--[OutfitID] = {Effect}
[159] = {23}
}
function onThink(cid, interval)
local effect = EFFECTS[getCreatureOutfit(cid).lookType]
if effect then
addEvent(effectSender, time*1000, {cid=cid, pos=getCreaturePos(cid), effect=effect[1]})
end
return true
end
function effectSender(p)
if isCreature(p.cid) then
local newPos = getCreaturePos(p.cid)
if newPos.x ~= p.pos.x or newPos.y ~= p.pos.y then
doSendMagicEffect(p.pos, p.effect)
end
end
end