Amiroslo
Excellent OT User
- Joined
- Jul 28, 2009
- Messages
- 6,767
- Solutions
- 5
- Reaction score
- 769
Hello smart people,
I have ran into an issue and found no fix sadly.
The script does the following:
Checks if a person is wearing xHead, xArmor, xLegs and xFeet. If they are wearing all 4, it turns their outfit to 309, and if one of them gets deEquiped, the outfit is removed and their old outfit is back.
The issue right now is, if a player tries to deEquip or tries to right click any items, the server crashes right away with no errors. Any idea why or how to fix that?
TFS 0.4, r3777
I have ran into an issue and found no fix sadly.
The script does the following:
Checks if a person is wearing xHead, xArmor, xLegs and xFeet. If they are wearing all 4, it turns their outfit to 309, and if one of them gets deEquiped, the outfit is removed and their old outfit is back.
The issue right now is, if a player tries to deEquip or tries to right click any items, the server crashes right away with no errors. Any idea why or how to fix that?
TFS 0.4, r3777
Lua:
local outfitStorage = 16011
local condition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition, CONDITION_PARAM_SUBID, 8)
addOutfitCondition(condition, {lookType = 309, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0})
function onEquip(cid, item, slot)
if getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == 9778 and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == 9776 and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == 9777 and getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == 2646 then
setPlayerStorageValue(cid,outfitStorage, getCreatureOutfit(cid).lookType)
doAddCondition(cid, condition)
end
return true
end
function onDeEquip(cid, item, slot)
local look = getPlayerStorageValue(cid, outfitStorage)
if look ~= -1 then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
local outfit = {lookType = look, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0}
doRemoveCondition(cid, CONDITION_OUTFIT, 8)
setPlayerStorageValue(cid, outfitStorage, -1)
end
return true
end
XML:
<movevent type="Equip" itemid="9778" slot="head" function="onEquipItem" event="script" value="donset.lua"/>
<movevent type="DeEquip" itemid="9778" slot="head" function="onDeEquipItem" event="script" value="donset.lua"/>
<movevent type="Equip" itemid="9776" slot="armor" function="onEquipItem" event="script" value="donset.lua"/>
<movevent type="DeEquip" itemid="9776" slot="armor" function="onDeEquipItem" event="script" value="donset.lua"/>
<movevent type="Equip" itemid="9777" slot="legs" function="onEquipItem" event="script" value="donset.lua"/>
<movevent type="DeEquip" itemid="9777" slot="legs" function="onDeEquipItem" event="script" value="donset.lua"/>
<movevent type="Equip" itemid="2646" slot="feet" function="onEquipItem" event="script" value="donset.lua"/>
<movevent type="DeEquip" itemid="2646" slot="feet" function="onDeEquipItem" event="script" value="donset.lua"/>
Last edited: