• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

New Idea:D outfits add if equip items.

ignas1415

Senior Member
Joined
May 15, 2008
Messages
54
Reaction score
0
Location
Europa/Poland
I welcome today a scrypt is presenting who after the equip item given the new addon or outfit lets go.

1# Example. If equip brown backpack(id=1988) you have first citizen addon
data\movements\scripts add addons.lua
Code:
function onEquip(cid, item, slot)
			if getPlayerSex(cid) == 1 then
				doPlayerAddOutfit(cid, 128, 1)
			elseif getPlayerSex(cid) == 2 then
				doPlayerAddOutfit(cid,136, 1)
			end
end	
function onDeEquip(cid, item, slot)
			if getPlayerSex(cid) == 1 then
				doPlayerRemOutfit(cid,128, 1)
			elseif getPlayerSex(cid) == 2 then
				doPlayerRemOutfit(cid,136, 1)
			end
			end
data\movements\movements.xml end the file add

Code:
<movevent event="Equip" itemid="1988" function="onEquipItem" slot="backpack" script="addon.lua"/>
<movevent event="DeEquip" itemid="1988" function="onDeEquipItem" slot="backpack" script="addon.lua"/>

2# Example. If equip item in backpack slot change outfit



local outfit =
{
lookType = 266,
}
/!\/!\/!\ It's CM outfit can change.
function onEquip(cid, item, slot)
doSetCreatureOutfit(cid, outfit, -1)
end
function onDeEquip(cid, item, slot)
doRemoveCondition(cid, CONDITION_OUTFIT)
end
<movevent event="Equip" itemid="YOUR ITEM ID! CHANGE IT" function="onEquipItem" slot="backpack" script="addon.lua"/>
<movevent event="DeEquip" itemid="YOUR ITEM ID! CHANGE IT" function="onDeEquipItem" slot="backpack" script="addon.lua"/>
 
Last edited by a moderator:
hi, why I do not work writes: "You cannot dress this object there"

I use: TFS 0.2.21 (tibia 8.4)
 
Back
Top