Transformar em um monstro que você se refere, é mudar a looktype?
Isso.
E como o player fará pra voltar ao "normal"? Por exemplo, após x tempo depois de ter usado o item?
De qualquer maneira, fiz dessa maneira. Veja se lhe satisfaz.
data/actions/scripts, crie um arquivo com extensão .lua, nomeie-o transform, e coloque o seguinte conteúdo:
function onUse(cid, item, frompos, item2, topos)
local cfg = {
remove = true, --Vai remover o item? [true/sim] [false/não]
tempo = x, --Tempo, em segundos, para voltar ao normal.
tempo_dois = x, --Cooldown para usar o item novamente, em segundos.
outfit = x, --ID da outfit.
}
if getPlayerStorageValue(cid, 918221) > os.time() then
return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 918221) - os.time().." segundo(s) para usar esse item novamente.")
end
doSetCreatureOutfit(cid, {lookType = cfg.outfit}, -1)
setPlayerStorageValue(cid, 918221, os.time() + cfg.tempo_dois)
if cfg.remove == true then
doRemoveItem(item.uid, 1)
end
addEvent(function()
if getCreatureCondition(cid, CONDITION_OUTFIT) then
doRemoveCondition(cid, CONDITION_OUTFIT)
end
end, cfg.tempo * 1000)
return true
end
<action itemid="id do item" event="script" value="transform.lua"/>
Editado Dezembro 7 por zipter98
Não tipo,ele poe o colar ele fica transformado,ele tira o colar ele volta ao normal.
Tipo,o monstro vai ser uma montaria,tem como o player ficar em cima do monstro (Montaria) ?
Editado Dezembro 7 por Mycry
function onUse(cid, item, frompos, item2, topos)
local cfg = {
tempo = x, --Cooldown para usar o item novamente, em segundos.
outfit = x, --ID da outfit.
}
local storage_one = 982011
local storage_two = 982012
if getPlayerStorageValue(cid, 918221) > os.time() then
return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 918221) - os.time().." segundo(s) para usar esse item novamente.")
end
if getPlayerStorageValue(cid, storage_one) >= 1 then
if getCreatureCondition(cid, CONDITION_OUTFIT) then
doRemoveCondition(cid, CONDITION_OUTFIT)
doPlayerSendTextMessage(cid, 27, "Você voltou ao normal!")
setPlayerStorageValue(cid, storage_one, -1)
setPlayerStorageValue(cid, storage_two, 1)
setPlayerStorageValue(cid, 918221, os.time() + cfg.tempo)
end
elseif getPlayerStorageValue(cid, storage_two) >= 1 then
doSetCreatureOutfit(cid, {lookType = cfg.outfit}, -1)
doPlayerSendTextMessage(cid, 27, "Você se transformou!")
setPlayerStorageValue(cid, storage_two, -1)
setPlayerStorageValue(cid, storage_one, 1)
setPlayerStorageValue(cid, 918221, os.time() + cfg.tempo)
end
return true
end
Editado Dezembro 7 por zipter98
Como tira o tempo? Tem como fazer transformar só quando clicar no item?
E não esta funcionando,é em actions que poe né?
-
function onUse(cid, item, frompos, item2, topos)local cfg = {tempo = 86400,outfit = <look type="254" head="0" body="77" legs="77" feet="114" corpse="6080"/>,}local storage_one = 982011local storage_two = 982012if getPlayerStorageValue(cid, 918221) > os.time() thenreturn doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 918221) - os.time().." segundo(s) para usar esse item novamente.")endif getPlayerStorageValue(cid, storage_one) >= 1 thenif getCreatureCondition(cid, CONDITION_OUTFIT) thendoRemoveCondition(cid, CONDITION_OUTFIT)doPlayerSendTextMessage(cid, 27, "Você voltou ao normal!")setPlayerStorageValue(cid, storage_one, -1)setPlayerStorageValue(cid, storage_two, 1)setPlayerStorageValue(cid, 918221, os.time() + cfg.tempo)endelseif getPlayerStorageValue(cid, storage_two) >= 1 thendoSetCreatureOutfit(cid, {lookType = cfg.outfit}, -1)doPlayerSendTextMessage(cid, 27, "Você se transformou!")setPlayerStorageValue(cid, storage_two, -1)setPlayerStorageValue(cid, storage_one, 1)setPlayerStorageValue(cid, 918221, os.time() + cfg.tempo)endreturn trueend
Editado Dezembro 7 por Mycry
Cara, não é assim que configura a outfit. Como eu disse, é o ID da outfit. Por exemplo, 114.
E tirar o tempo = tirar exausted? Se for,
function onUse(cid, item, frompos, item2, topos)
local outfit = xxx --ID da outfit.
local storage_one = 982011
local storage_two = 982012
if getPlayerStorageValue(cid, storage_one) >= 1 then
if getCreatureCondition(cid, CONDITION_OUTFIT) then
doRemoveCondition(cid, CONDITION_OUTFIT)
doPlayerSendTextMessage(cid, 27, "Você voltou ao normal!")
setPlayerStorageValue(cid, storage_one, -1)
setPlayerStorageValue(cid, storage_two, 1)
end
elseif getPlayerStorageValue(cid, storage_two) >= 1 then
doSetCreatureOutfit(cid, {lookType = outfit}, -1)
doPlayerSendTextMessage(cid, 27, "Você se transformou!")
setPlayerStorageValue(cid, storage_two, -1)
setPlayerStorageValue(cid, storage_one, 1)
end
return true
end
E com essa configuração que você colocou, ficaria assim:
function onUse(cid, item, frompos, item2, topos)
local storage_one = 982011
local storage_two = 982012
if getPlayerStorageValue(cid, storage_one) >= 1 then
if getCreatureCondition(cid, CONDITION_OUTFIT) then
doRemoveCondition(cid, CONDITION_OUTFIT)
doPlayerSendTextMessage(cid, 27, "Você voltou ao normal!")
setPlayerStorageValue(cid, storage_one, -1)
setPlayerStorageValue(cid, storage_two, 1)
end
elseif getPlayerStorageValue(cid, storage_two) >= 1 then
doSetCreatureOutfit(cid, {lookType = 254, lookBody = 77, lookHead = 0, lookLegs = 77, lookFeet = 114}, -1)
doPlayerSendTextMessage(cid, 27, "Você se transformou!")
setPlayerStorageValue(cid, storage_two, -1)
setPlayerStorageValue(cid, storage_one, 1)
end
return true
end
Editado Dezembro 7 por zipter98
Ainda não funciona o id do item é 10220. Como devo colocar corretamente?Em Actions?
Movements, colartrans.lua.
function onEquip(cid, item, slot)
doPlayerSendTextMessage(cid, 27, "Você se transformou.")
doSetCreatureOutfit(cid, {lookType = 254, lookBody = 77, lookHead = 0, lookLegs = 77, lookFeet = 114}, -1)
return true
end
function onDeEquip(cid, item, slot)
doPlayerSendTextMessage(cid, 27, "Você voltou ao normal.")
if getCreatureCondition(cid, CONDITION_OUTFIT) then
doRemoveCondition(cid, CONDITION_OUTFIT)
end
return true
end
<movevent type="Equip" itemid="10220" slot="necklace" event="script" value="colartrans.lua"/> <movevent type="DeEquip" itemid="10220" slot="necklace" event="script" value="colartrans.lua"/>
Editado Dezembro 8 por zipter98
Duvida sanada ,obrigado.






info
Grupo: Campones
Registrado: 22/11/13
Posts: 51
Reputação: 0
Olá,preciso de um script que transforme o player em um montro quando usar um colar.
Alguém pode ajudar?