local c = {
outfit = {lookType = 160, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0},
time = 1, -- Hours
gm = 3
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerAccess(cid) < c.gm) then
if(getCreatureOutfit(cid).looktype ~= c.outfit) then
doSetCreatureOutfit(cid, c.outfit, c.time * 3600)
doRemoveItem(item.uid)
else
doPlayerSendCancel(cid, "You already look like a dwarf.")
end
else
doPlayerSendCancel(cid, "Gamemasters do not need to change their outfits.")
end
return true
end
were i need to put that script??Code:local c = { outfit = {lookType = 160, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, time = 1, -- Hours gm = 3 } function onUse(cid, item, fromPosition, itemEx, toPosition) if(getPlayerAccess(cid) < c.gm) then if(getCreatureOutfit(cid, c.outfit) == false) then doSetCreatureOutfit(cid, c.outfit, c.time * 3600) doRemoveItem(item.uid) else doPlayerSendCancel(cid, "You already look like a dwarf.") end else doPlayerSendCancel(cid, "Gamemasters do not need to change their outfits.") end return true end
you need to remove it from food.lua and/or remove the line where it's registered to food.luaDont Work if i use the item id it says only MMMMM ... if i use it :S
i wanna give it to the players for present![]()
You both used the function wrong, and compared tables the wrong way. I would do something like this:Code:if(getCreatureOutfit(cid, c.outfit) == false) then
if(getCreatureOutfit(cid).lookType ~= c.outfit.lookType) then