Olá,preciso de um script que transforme o player em um montro quando usar um colar.
Alguém pode ajudar?
Olá,preciso de um script que transforme o player em um montro quando usar um colar.
Alguém pode ajudar?
Transformar em um monstro que você se refere, é mudar a looktype?
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.
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"/>
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.
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) ?
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
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.
Como tira o tempo? Tem como fazer transformar só quando clicar no item?
E não esta funcionando,é em actions que poe né?
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
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.
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"/>
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.
Duvida sanada ,obrigado.
Tópico movido para a seção de dúvidas e pedidos resolvidos.
Bons tempos...
[Portfólio de scripts]