[Ajuste] REP DOOR

DaniF
Por DaniF
em Scripts

DaniF

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 14/01/14Posts: 15

Boa noite galera,

 

Bom eu queria q alguem pudesse da uns ajustes aqui pra mim, eu tentei da uma modificada, mas não deu certo, rs

O sistema da porta, so permite REP positivos passarem "1500", queria q "-1500" tambem podessem passar. Tão quanto a positivo, como também negativos. Obrigado.

function onUse(cid, item, frompos, item2, topos)
local config = {
      repNeeded = 1500
}

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,"Apenas players com " .. config.repNeeded .. " Reputução POSITIVAS podem passar.")
end
return TRUE
end 

Caronte

Ex-Moderador de Scripting
avatar
Marquês
Marquês

INFOS

Grupo: MarquêsRegistrado: 25/09/10Posts: 1341Gênero: Masculino

Pegue essa parte:

if getRepPoints(cid) >= config.repNeeded then
Mude para:

if math.abs(getRepPoints(cid)) >= math.abs(config.repNeeded) then