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

Equip and change outfit

Appzyt

New Member
Joined
Jun 1, 2008
Messages
92
Reaction score
0
Argh!

Cant get this to work, can someone lend me a hand real fast?

Lua:
local outfit = 361

function onEquip(cid, item, slot)
    doCreatureChangeOutfit(cid, outfit)
end

and

XML:
<movevent type="Equip" itemid="3972" slot="head" level="20" event="script" value="outfit.lua">
	</movevent>
	<movevent type="DeEquip" itemid="3972" slot="head" event="function" value="onDeEquipItem"/>
 
Lua:
local outfit = getCreatureOutfit(cid)
outfit.lookType = 301   -- your outfit 
 
function onEquip(cid, item, slot)
    doCreatureChangeOutfit(cid, outfit)
end
 
Unfourtunaly this does not seem to be working for me. The idea is simple: Equip item and transform to outfit="xxx and when DeEquip you get outfit you were last in before you Equip the item. Could someone help me?
 
Still not working. What I have right now is:

Lua:
local outfit = {lookType = 361, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}

function onEquip(cid, item, slot)
		doSendMagicEffect(getThingPos(cid), 40)
		doSetCreatureOutfit(cid, outfit, -1)
			
	end
	
	function onDeEquip(cid, item, slot)
		doRemoveCondition(param.cid, CONDITION_OUTFIT) 
	
end

	return TRUE

Something in here is not right, anyone?
 
should be like that
Lua:
local look = 320 -- your outfitt

local outfit = createConditionObject(CONDITION_OUTFIT)
setConditionParam(outfit, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(outfit, {lookType = look ,lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0})
 
function onEquip(cid, item, slot)
		doSendMagicEffect(getThingPos(cid), 40)
		doAddCondition(cid, outfit )
	return true
end
 
function onDeEquip(cid, item, slot)
	doRemoveCondition(cid, CONDITION_OUTFIT) 
	return true
end
 

  1. Make this script, make the outfit and not the colors




  2. local look = 320 -- your outfitt

  3. local outfit = createConditionObject(CONDITION_OUTFIT)
  4. setConditionParam(outfit, CONDITION_PARAM_TICKS, -1)
  5. addOutfitCondition(outfit, {lookType = look ,lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0})

  6. function onEquip(cid, item, slot)
  7. doSendMagicEffect(getThingPos(cid), 40)
  8. doAddCondition(cid, outfit )
  9. return true
  10. end

  11. function onDeEquip(cid, item, slot)
  12. doRemoveCondition(cid, CONDITION_OUTFIT)
  13. return true
  14. end

 
Change lookType.

Lua:
function onEquip(cid, item, slot)
  local out = getCreatureOutfit(cid)
local outfit = {lookType = out.lookType, lookHead = out.lookHead, lookBody = out.lookBody, lookLegs = out.lookLegs, lookFeet = out.lookFeat, lookTypeEx = out.lookTypeEx, lookAddons = 3}
addEvent(doCreatureChangeOutfit, 1, cid, outfit)
  return true
  end

function onDeEquip(cid, item, slot)
  local out = getCreatureOutfit(cid)
local outfit = {lookType = out.lookType, lookHead = out.lookHead, lookBody = out.lookBody, lookLegs = out.lookLegs, lookFeet = out.lookFeat, lookTypeEx = out.lookTypeEx, lookAddons = 0}
addEvent(doCreatureChangeOutfit, 1, cid, outfit)
return true
end

@Edit
Sorry, I did not notice the date of creation of the topic.
 
Last edited:
Back
Top