SK

Somente uma certa vocation passa pelo tile se não perde 10k

Por SkyLigh, 07 de abr. de 2013 em Actions e Talkactions

moveevent
script
9
1.1k
SkyLighS
07 de abril de 2013 às 21:03

Falaa galera to de volta com mais um script mais dessa vez um pouco mais inovador então gogo .

 

Vá em data / movements / scripts / renome algum arquivo para vocmoney.lua

 

é adicione .

 

   function onStepIn(cid, item, pos, frompos)

   local config = {
         vocation = 4, -- Needed vocation
         storage = 13820 -- No change!
   }

         if getPlayerVocation(cid) == config.vocation then
            if getPlayerStorageValue(cid, config.storage) <= -1 then
               doPlayerSendTextMessage(cid, 22, "You are not Knight, if you pass here again lose 10k!")
                 doTeleportThing(cid, frompos, true)
                   setPlayerStorageValue(cid, config.storage , 1)
   return true
            end
         end

         if getPlayerStorageValue(cid, config.storage) >= 1 then
            if doPlayerRemoveMoney(cid, 10000) == TRUE then
               doPlayerSendTextMessage(cid,22,"You lose 10k!")
                  setPlayerStorageValue(cid, config.storage, -1)
               return true
               end
            end
               return true
            end

 

em movements.xml

 

<movevent type="StepIn" actionid="3910" event="script" value="vocmoney.lua"/>

 

Então divirta-se !!

Editado Abril 8 por SkyLigh

RoksasR
07 de abril de 2013 às 21:10

Poxa, que tal

if doPlayerRemoveMoney(cid, 10000) == true then

 

Em vez de

 

if doPlayerRemoveMoney(cid, 10000) == TRUE then

 

E aí no caso ele so vai perder 10k uma vez, se passar de novo não perde. Que tal verificar uma storage quando pisar e mudá-la depois de perde o money? :)

DelaksD
07 de abril de 2013 às 22:46

Não entendi muito bem,mas muito bom script rep+

SkymagnumS
07 de abril de 2013 às 23:32

Não funciona, vai aprender a programar primeiro Sky ;d.

heuheuhe como um cara pode sre mod se n sabe faze um script desse pqp?

Editado Abril 7 por Skymagnum

VincV
08 de abril de 2013 às 15:39

smartbox esse seus script macarronicos.

fih, se testo esse treco, n funciona n .

 if getPlayerVocation(cid,vocation) then -- getPlayerVocation(cid) só recebe uma varivel a segunda n serve pra nada,ou seja qualquer vocação
...
return true  -- script acabo aki

RoksasR
08 de abril de 2013 às 15:49

Sky, dei uma melhoradinha básica pra tu :)

 

http://pastebin.com/v4vhW6gk

Editado Abril 8 por Roksas

VincV
08 de abril de 2013 às 16:19

se tive usando otscriptlive,para de usa porque a indentação ta toda zuada.

 

continua tendo um erro

 

se muda o storage do cara pra 1 e depois checa se é 1,obvio que vai ser true

coloca um return true depois do "setPlayerStorageValue(cid, config.storage , 1)",que arruma.

SkyLighS
08 de abril de 2013 às 20:55

Arrumado .

kaiotpK
08 de abril de 2013 às 20:58

pra que server esse comando