Geekout1245
New Member
- Joined
- Feb 21, 2019
- Messages
- 1
- Reaction score
- 0
I want to create an item that when placed in the inventory it activates a new outfit to the player and when it is removed from the inventory the player returns his outfit from before but outfit what i want to set saving in storage. TFS 0.3.6
Code:
function onEquip(cid, item, slot)
local storage = 16007
setPlayerStorageValue(cid, 16010, getCreatureOutfit(cid).lookType)
if getPlayerVocation(cid) == 18 or getPlayerVocation(cid) == 19 or getPlayerVocation(cid) == 20 or getPlayerVocation(cid) == 21 or getPlayerVocation(cid) == 22 then
local outfit = {lookType = 701, lookHead = 0 , lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}
doSetCreatureOutfit(cid, outfit, -1)
end
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == 8819 then
setPlayerStorageValue(cid, 16011, 1)
end
return true
end
function onDeEquip(cid, item, slot)
local storage = 16007
if getPlayerStorageValue(cid, 16011) == 1 then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
local outfit = {lookType = getPlayerStorageValue(cid, 16010) , lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0}
doSetCreatureOutfit(cid, outfit, -1)
setPlayerStorageValue(cid, 16011, 0)
end
end