Eu não manjo muito Lua, mas tenho uma boa lógica de programação.
Portanto, dei apenas uma mexida no script adicionado acima..
function onUse(cid, item)
local outfit = {lookType = 302, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0} -- Outift e as cores
local val = db.getResult("SELECT `looktype` FROM `players` WHERE `id` = "..getPlayerGUID(cid)..";") -- Nao Mexa
pos = getPlayerPosition(cid)
while getPlayerPosition(cid) = pos do
if setPlayerStorageValue(cid, 31010, val:getDataString("looktype")) then
doCreatureChangeOutfit(cid, outfit)
return TRUE
end
end
doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, 31010)})
return TRUE
end
Ideologia?
-> Enquanto a posição do player não mudar depois que usar e for alterado o outfit,... o outfit permanece.
Quando ele se mover, ou seja, mudar a posição, o outfit some.
Sei la, é testar agora.
Oops, correção, coloque um = depois do = na declaração do while