HE

[RESOLVIDO] Trocar Looktype e Ficar sem andar

Por HeelNox, 14 de ago. de 2013 em Scripts

resolvido
script
35
4.1k
RoksasR
16 de agosto de 2013 às 19:12

Dark, eu tinha mudado o meu script, ve la meu ultimo post.

HeelNoxH
17 de agosto de 2013 às 07:24

Continua mesmo erro !!!

RoksasR
17 de agosto de 2013 às 09:35

Fiz um do início, vamos ver se funciona agora:

function onSay(cid, words, param)

local vocs = {
[1] = 123,
[2] = 231,
[3] = 98,
[4] = 76,
}

if not vocs[getPlayerVocation(cid)] then
return true
end

if getPlayerStorageValue(cid, 9329) < 1 then
doCreatureSetNoMove(cid, true)
setPlayerStorageValue(cid, 9329, 1)
doSetCreatureOutfit(cid, vocs[getPlayerVocation(cid)], -1)
elseif getPlayerStorageValue(cid, 9329) >= 1 then
doCreatureSetNoMove(cid, false)
setPlayerStorageValue(cid, 9329, -1)
doRemoveCondition(cid, CONDITION_OUTFIT)
end
return true
end

Nesta parte, você tem que mudar:

local vocs = {
[1] = 123,
[2] = 231,
[3] = 98,
[4] = 76,
}

Entre [ e ] é o ID da vocação e o número ao lado é o lookType.

#GoodLuck.

Editado Agosto 17 por Roksas

VodkartV
17 de agosto de 2013 às 09:41

/\

 

falto fechar o if com um end ai fera xd

HeelNoxH
17 de agosto de 2013 às 10:13

Funcionou mais não ta trocando a looktype

 

[17/08/2013 10:12:49] [Error - TalkAction Interface]
[17/08/2013 10:12:49] data/talkactions/scripts/sit.lua:onSay
[17/08/2013 10:12:49] Description:
[17/08/2013 10:12:49] attempt to index a number value
[17/08/2013 10:12:49] stack traceback:
[17/08/2013 10:12:49] [C]: in function 'doSetCreatureOutfit'
[17/08/2013 10:12:49] data/talkactions/scripts/sit.lua:16: in function <data/talkactions/scripts/sit.lua:1>

 

 

Editado Agosto 17 por DarkHeel

VodkartV
17 de agosto de 2013 às 10:21

vc mudou os ids ta looktype?

HeelNoxH
17 de agosto de 2013 às 10:31

vc mudou os ids ta looktype?

Sim

 

 

function onSay(cid, words, param)

local vocs = {
[1] = 538,
[2] = 585,
[3] = 536,
}
if not vocs[getPlayerVocation(cid)] then
return true
end
if getPlayerStorageValue(cid, 9329) < 1 then
doCreatureSetNoMove(cid, true)
setPlayerStorageValue(cid, 9329, 1)
doSetCreatureOutfit(cid, vocs[getPlayerVocation(cid)], -1)
elseif getPlayerStorageValue(cid, 9329) >= 1 then
doCreatureSetNoMove(cid, false)
setPlayerStorageValue(cid, 9329, -1)
doRemoveCondition(cid, CONDITION_OUTFIT)
end
return true
end
VodkartV
17 de agosto de 2013 às 10:37

ah eh pq o roksas não usou o parâmetro certo na função, tem que colocar {lookType}

function onSay(cid, words, param)
 
local vocs = {
[1] = 538,
[2] = 585,
[3] = 536,
}
 
if not vocs[getPlayerVocation(cid)] then
return true
end
if getPlayerStorageValue(cid, 9329) < 1 then
doCreatureSetNoMove(cid, true)
setPlayerStorageValue(cid, 9329, 1)
doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
elseif getPlayerStorageValue(cid, 9329) >= 1 then
doCreatureSetNoMove(cid, false)
setPlayerStorageValue(cid, 9329, -1)
doRemoveCondition(cid, CONDITION_OUTFIT)
end
return true
end

Editado Agosto 17 por Vodkart

RoksasR
17 de agosto de 2013 às 10:39

Ah perdão galera, me esqueci que é uma tabela outfits rsrs. {lookType, lookHead, lookBody, etc}.

 

#GoodLuck!

HeelNoxH
17 de agosto de 2013 às 10:45

Vlw REP+ para os dois , mais teria como por para healar 5 de hp por segundo ?

 

6fdn.jpg


 

Editado Agosto 17 por DarkHeel

RoksasR
17 de agosto de 2013 às 10:49

#Perfect

 

 

function onSay(cid, words, param)

local hpGain = 5
local vocs = {
    [1] = 538,
    [2] = 585,
    [3] = 536,
}
 
if not vocs[getPlayerVocation(cid)] then
    return true
end

if getPlayerStorageValue(cid, 9329) < 1 then
    heal(cid, hpGain)
    doCreatureSetNoMove(cid, true)
    setPlayerStorageValue(cid, 9329, 1)
    doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
    
elseif getPlayerStorageValue(cid, 9329) >= 1 then
    doCreatureSetNoMove(cid, false)
    setPlayerStorageValue(cid, 9329, -1)
    doRemoveCondition(cid, CONDITION_OUTFIT)
end
    return true
end

function heal(uid, hp)

if not isPlayer(uid) then
    return true
end

if getPlayerStorageValue(uid, 9329) < 1 then
    return true
end

doCreatureAddHealth(uid, hp)
    return addEvent(heal, 1 * 1500, uid, hp)
end
HeelNoxH
17 de agosto de 2013 às 10:53

 

#Perfect

function onSay(cid, words, param)

local hpGain = 5
local vocs = {
    [1] = 538,
    [2] = 585,
    [3] = 536,
}
 
if not vocs[getPlayerVocation(cid)] then
    return true
end

if getPlayerStorageValue(cid, 9329) < 1 then
    heal(cid, hpGain)
    doCreatureSetNoMove(cid, true)
    setPlayerStorageValue(cid, 9329, 1)
    doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
    
elseif getPlayerStorageValue(cid, 9329) >= 1 then
    doCreatureSetNoMove(cid, false)
    setPlayerStorageValue(cid, 9329, -1)
    doRemoveCondition(cid, CONDITION_OUTFIT)
end
    return true
end

function heal(uid, hp)

if not isPlayer(uid) then
    return true
end

if getPlayerStorageValue(uid, 9329) < 1 then
    return true
end

doCreatureAddHealth(uid, hp)
    return addEvent(heal, 1 * 1500, uid, hp)
end

 

Num ta healando D=

RoksasR
17 de agosto de 2013 às 10:58

Tente com um player, e tenha certeza de que sua vida não está cheia ¬¬

MaenilseM
17 de agosto de 2013 às 10:58

tome esse. acho que ele eskeçeu de colocar o hpGain no ultimo rs.

 

function onSay(cid, words, param)

local hpGain = 5
local vocs = {
    [1] = 538,
    [2] = 585,
    [3] = 536,
}
 
if not vocs[getPlayerVocation(cid)] then
    return true
end

if getPlayerStorageValue(cid, 9329) < 1 then
    heal(cid, hpGain)
    doCreatureSetNoMove(cid, true)
    setPlayerStorageValue(cid, 9329, 1)
    doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
    
elseif getPlayerStorageValue(cid, 9329) >= 1 then
    doCreatureSetNoMove(cid, false)
    setPlayerStorageValue(cid, 9329, -1)
    doRemoveCondition(cid, CONDITION_OUTFIT)
end
    return true
end

function heal(uid, hp)

if not isPlayer(uid) then
    return true
end

if getPlayerStorageValue(uid, 9329) < 1 then
    return true
end

doCreatureAddHealth(uid, hpGain)
    return addEvent(heal, 1 * 1500, uid, hp)
end
SlicerS
17 de agosto de 2013 às 11:04

rok coloque a funçao heal(..., ...) embaixo do setStorageValue... se n nunca vai healar ms... ¬¬