TR

[Action] Porta De Rep

Por Triico, 22 de dez. de 2011 em Archived

script
4
569
TriicoT
22 de dezembro de 2011 às 13:10

Olá,

 

Possuo em meu server um script que só deixa um player entrar em tal porta se ele tiver X quantia de REP.

 

Porém, ao abrir a porta, ocorre o seguinte erro na distro e o player entra normalmente na porta:

 

Erro :

[Error - Action Interface]

data/actions/scripts/rep/rep3.lua:onUse

Description:

data/actions/scripts/rep/rep3.lua:6: attempt to call global 'getRepPoints' (a nil value)

stack traceback:

data/actions/scripts/rep/rep3.lua:6: in function (data/actions/scripts/rep/rep3.lua:1 )

 

E segue também o script:

 

rep3.lua :

 

function onUse(cid, item, frompos, item2, topos)

local config = {

repNeeded = -5000

}

 

if getRepPoints(cid) <= config.repNeeded then

pos = getPlayerPosition(cid)

 

if pos.x == topos.x then

if pos.y < topos.y then

pos.y = topos.y + 1

else

pos.y = topos.y - 1

end

 

elseif pos.y == topos.y then

if pos.x < topos.x then

pos.x = topos.x + 1

else

pos.x = topos.x - 1

end

else

doPlayerSendTextMessage(cid,22,'Stay in front of the door.')

return 1

end

 

doTeleportThing(cid,pos)

doSendMagicEffect(topos,12)

else

doPlayerSendTextMessage(cid,22,"Only players with " .. config.repNeeded .. " reputation can open the chest.")

end

return TRUE

end

 

Obrigado!

VincV
22 de dezembro de 2011 às 15:00

ta falando que seu serve n tem a função 'getRepPoints'

TriicoT
22 de dezembro de 2011 às 18:25

ta falando que seu serve n tem a função 'getRepPoints'

 

Como posso adicionar essa função? :S

VincV
23 de dezembro de 2011 às 13:52

isso depende do script de rep que tu usa

se vai te que cria essa função na lib(mais tem que fase ela, n é so por o nome dela(uma ves um cara coloco so o nome e acho que fosse funciona ¬¬))