• 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!

[MOVEMENT] Effect on Walk-Outfit

Michy

Member
Joined
May 20, 2010
Messages
105
Reaction score
6
I need help
When you have the outfit will leave an effect on walking


Outfit 159 ...
Effect 23 ...

Help plix
 
Last edited:
Lua:
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

Make it a CreatureEvent and register it at Login
 
But if it worked for a summon?
and another thing to get the effect as 2 seconds of walking
Well look at all the one with the outfit you will leave the effect

I add this in the monster:

ione esto en el monster:

<script>
<event name="Cami-Magmar"/>
</script>


But get this error if I give / r:
[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.lua:eek:nThink
[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.lua:eek:nThink
[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>
 
Last edited:
Lua:
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

That should work exactly how you want.
 
Back
Top