IU

[Creaturescript] Evento Onlogin Que Dá O Player Uma Determinada Velocide De Acordo Com A Storage

Por iurygoncalves, 07 de jul. de 2010 em Archived

script
6
1.1k
07 de julho de 2010 às 17:34

Estou fazendo esse código, mas não consegui fazê-lo funcionar.

Peço a ajuda de você para analizar o script e ver onde está o erro.

 

function onLogin(cid)
local speed = 300
local speed2 = 600
local speed3 = 900

if getPlayerStorageValue(cid, 5555) == 0 then
	doChangeSpeed(cid, speed)
elseif getPlayerStorageValue(cid, 5555) == 1 then
	doChangeSpeed(cid, speed2)
elseif getPlayerStorageValue(cid, 5555) == 2 then
	doChangeSpeed(cid, speed3)
else
end
end

 

Obrigado a todos.

OneshotO
07 de julho de 2010 às 17:39

iurygoncalves,

Qual o erro que está ocorrendo?

07 de julho de 2010 às 18:36

Dá conflito e os chares não entram no ot .. abre a lista de Characters, você seleciona e ele fica como se tivesse entrando, mas não entra.

OneshotO
07 de julho de 2010 às 22:06

iurygoncalves,

Como isso é uma função usada em creaturescripts,

Você certificou-se de registrar esse evento no arquivo login.lua* e em creaturescripts.xml?

 

E retire aquele else

 

* - '/creaturescripts/scripts'

 

registerCreatureEvent(cid, "Mesmo nome dado em creaturescripts.xml")

Cya

3 semanas depois...
WiltryW
26 de julho de 2010 às 15:28

Na verdade, faltou o return TRUE '-'

function onLogin(cid)

local speed = 300

local speed2 = 600

local speed3 = 900

 

if getPlayerStorageValue(cid, 5555) == 0 then

doChangeSpeed(cid, speed)

elseif getPlayerStorageValue(cid, 5555) == 1 then

doChangeSpeed(cid, speed2)

elseif getPlayerStorageValue(cid, 5555) == 2 then

doChangeSpeed(cid, speed3)

else

end

return TRUE

end

marcelo1025M
26 de julho de 2010 às 17:03

Num entendi nada pod explicar melhor