potinho
Advanced OT User
Hello everyone, everything good?
I created an outfit mechanic for my old server, where when using an item the player gets a specific looktype. The problem is, since the item cannot be removed, it can be loaned to anyone. Is there a way for the item to be exclusive to the first player who uses it? And make it possible to give use other times.
skin.lua
I created an outfit mechanic for my old server, where when using an item the player gets a specific looktype. The problem is, since the item cannot be removed, it can be loaned to anyone. Is there a way for the item to be exclusive to the first player who uses it? And make it possible to give use other times.
skin.lua
Lua:
function onUse(cid, item)
--------------------------------------------------
local dolls = {
[5220] = {outfit = 335, name = "Demon"},
[5217] = {outfit = 334, name = "Golden"},
[5269] = {outfit = 75, name = "GameMaster"},
[5210] = {outfit = 332, name = "Pumpking"},
}
---------------------------------------------------
local go = dolls[item.itemid]
---------------------------------------------------
if go then
if getCreatureOutfit (cid).lookType ~= go.outfit then
doCreatureChangeOutfit(cid, { lookType = go.outfit})
doCreatureSay(cid, "Skin "..go.name..".", TALKTYPE_ORANGE_1)
return true
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'The skin is already in use.')
return true
end
end
end