Ir para conteúdo
  • 0

Alguém Olha Esse Script Para Min


rhamer

Pergunta

Tipo do script: creaturescripts

Protocolo (versão do Tibia): 8.60

Servidor utilizado: Rook War

Nível de experiência: Baixo

Adicionais/Informações:eu peguei esse script aqui no fórum ele serve para dividir os times quando os player entra no ot e quando ele morre ele vai para o time que esta com menos jogadores so que não esta dando certo alguém olhe o script e tire um conclusa para min por favor sou muito ruim em scripts.

 

 

local config = {
   storageTeamOne = 68473,
   storageTeamTwo = 68474,
   teamOne = { outfitMale =  {lookType = 128, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94, lookAddons = 3}, -- 94 representa a cor vermelha.
               outfitFemale =  {lookType = 136, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94, lookAddons = 3},
               templeId = 3
             },
   teamTwo = { outfitMale =  {lookType = 128, lookHead = 82, lookBody = 82, lookLegs = 82, lookFeet = 82, lookAddons = 3}, -- 82 representa a cor verde.
               outfitFemale =  {lookType = 136, lookHead = 82, lookBody = 82, lookLegs = 82, lookFeet = 82, lookAddons = 3},
               templeId = 2
             }
}

function onLogin(cid)
local vermelho = getGlobalStorageValue(config.teamOne)
local verde = getGlobalStorageValue(config.storageTeamTwo)
if vermelho > verde then
   if getPlayerSex(cid) == 0 then
       doCreatureChangeOutfit(cid, config.teamTwo.outfitFemale)
   else
       doCreatureChangeOutfit(cid, config.teamTwo.outfitMale)
   end  
   doTeleportThing(cid, getTownTemplePosition(config.teamTwo.templeId))
   setGlobalStorageValue(config.storageTeamTwo, verde+1)
   setPlayerStorageValue(cid, config.storageTeamTwo, 1)
else
   if getPlayerSex(cid) == 0 then
       doCreatureChangeOutfit(cid, config.teamOne.outfitFemale)
   else
       doCreatureChangeOutfit(cid, config.teamOne.outfitMale)
   end  
   doTeleportThing(cid, getTownTemplePosition(config.teamOne.templeId))
   setGlobalStorageValue(config.teamOne, vermelho+1)
   setPlayerStorageValue(cid, config.teamOne, 1)
end
registerCreatureEvent(cid, "LogoutTeam")
registerCreatureEvent(cid, "DeathTeam")
return true
end

function onDeath(cid, corpse, deathList)
if getPlayerStorageValue(cid, config.storageTeamTwo) == 1 then
   setPlayerStorageValue(cid, config.storageTeamTwo, 0)
   setGlobalStorageValue(config.storageTeamTwo, getGlobalStorageValue(config.storageTeamTwo)-1)
else
   setPlayerStorageValue(cid, config.teamOne, 0)
   setGlobalStorageValue(config.teamOne, getGlobalStorageValue(config.teamOne)-1)
end
return true
end

function onLogout(cid)
if getPlayerStorageValue(cid, config.storageTeamTwo) == 1 then
   setPlayerStorageValue(cid, config.storageTeamTwo, 0)
   setGlobalStorageValue(config.storageTeamTwo, getGlobalStorageValue(config.storageTeamTwo)-1)
else
   setPlayerStorageValue(cid, config.teamOne, 0)
   setGlobalStorageValue(config.teamOne, getGlobalStorageValue(config.teamOne)-1)
end
return true
end

 

Editado por Rhamer
Link para o comentário
Compartilhar em outros sites

9 respostass a esta questão

Posts Recomendados

  • 0

 

 

local config = {

storageTeamOne = 68473,

storageTeamTwo = 68474,

teamOne = { outfitMale = {lookType = 128, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94, lookAddons = 3}, -- 94 representa a cor vermelha.

outfitFemale = {lookType = 136, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94, lookAddons = 3},

templeId = 3

},

teamTwo = { outfitMale = {lookType = 128, lookHead = 82, lookBody = 82, lookLegs = 82, lookFeet = 82, lookAddons = 3}, -- 82 representa a cor verde.

outfitFemale = {lookType = 136, lookHead = 82, lookBody = 82, lookLegs = 82, lookFeet = 82, lookAddons = 3},

templeId = 2

}

}

 

function onLogin(cid)

local vermelho = getGlobalStorageValue(config.storageTeamOne)

local verde = getGlobalStorageValue(config.storageTeamTwo)

if vermelho > verde then

if getPlayerSex(cid) == 0 then

doCreatureChangeOutfit(cid, config.teamTwo.outfitFemale)

else

doCreatureChangeOutfit(cid, config.teamTwo.outfitMale)

end

doTeleportThing(cid, getTownTemplePosition(config.teamTwo.templeId))

setGlobalStorageValue(config.storageTeamTwo, verde+1)

setPlayerStorageValue(cid, config.storageTeamTwo, 1)

else

if getPlayerSex(cid) == 0 then

doCreatureChangeOutfit(cid, config.teamOne.outfitFemale)

else

doCreatureChangeOutfit(cid, config.teamOne.outfitMale)

end

doTeleportThing(cid, getTownTemplePosition(config.teamOne.templeId))

setGlobalStorageValue(config.storageteamOne, vermelho+1)

setPlayerStorageValue(cid, config.storageteamOne, 1)

end

registerCreatureEvent(cid, "LogoutTeam")

registerCreatureEvent(cid, "DeathTeam")

return true

end

 

function onDeath(cid, corpse, deathList)

if getPlayerStorageValue(cid, config.storageTeamTwo) == 1 then

setPlayerStorageValue(cid, config.storageTeamTwo, 0)

setGlobalStorageValue(config.storageTeamTwo, getGlobalStorageValue(config.storageTeamTwo)-1)

else

setPlayerStorageValue(cid, config.storageteamOne, 0)

setGlobalStorageValue(config.storageteamOne, getGlobalStorageValue(config.storageteamOne)-1)

end

return true

end

 

function onLogout(cid)

if getPlayerStorageValue(cid, config.storageTeamTwo) == 1 then

setPlayerStorageValue(cid, config.storageTeamTwo, 0)

setGlobalStorageValue(config.storageTeamTwo, getGlobalStorageValue(config.storageTeamTwo)-1)

else

setPlayerStorageValue(cid, config.storageteamOne, 0)

setGlobalStorageValue(config.storageteamOne, getGlobalStorageValue(config.storageteamOne)-1)

end

return true

end

 

Testa ai amigo, tinhas umas coisas que não tinha no seu script e eu adicinei é oque está colorido.

Link para o comentário
Compartilhar em outros sites

  • 0

deu nada continua do msm geito ja perdi mt player por isso vlw ai por quem ta tentando me ajudar.

talves nao pode ser outro script colidindo com ele sera ?

Editado por Rhamer
Link para o comentário
Compartilhar em outros sites

  • 0

 

 

local config = {

storageTeamOne = 68473,

storageTeamTwo = 68474,

teamOne = { outfitMale = {lookType = 128, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94, lookAddons = 3}, -- 94 representa a cor vermelha.

outfitFemale = {lookType = 136, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94, lookAddons = 3},

templeId = 3

},

teamTwo = { outfitMale = {lookType = 128, lookHead = 82, lookBody = 82, lookLegs = 82, lookFeet = 82, lookAddons = 3}, -- 82 representa a cor verde.

outfitFemale = {lookType = 136, lookHead = 82, lookBody = 82, lookLegs = 82, lookFeet = 82, lookAddons = 3},

templeId = 2

}

}

 

function onLogin(cid)

local vermelho = getGlobalStorageValue(config.storageTeamOne)

local verde = getGlobalStorageValue(config.storageTeamTwo)

if vermelho > verde then

if getPlayerSex(cid) == 0 then

doCreatureChangeOutfit(cid, config.teamTwo.outfitFemale)

else

doCreatureChangeOutfit(cid, config.teamTwo.outfitMale)

end

doTeleportThing(cid, getTownTemplePosition(config.teamTwo.templeId))

setGlobalStorageValue(config.storageTeamTwo, verde+1)

setPlayerStorageValue(cid, config.storageTeamTwo, 1)

else

if getPlayerSex(cid) == 0 then

doCreatureChangeOutfit(cid, config.storageteamOne.outfitFemale)

else

doCreatureChangeOutfit(cid, config.storageteamOne.outfitMale)

end

doTeleportThing(cid, getTownTemplePosition(config.teamOne.templeId))

setGlobalStorageValue(config.storageteamOne, vermelho+1)

setPlayerStorageValue(cid, config.storageteamOne, 1)

end

registerCreatureEvent(cid, "LogoutTeam")

registerCreatureEvent(cid, "DeathTeam")

return true

end

 

function onDeath(cid, corpse, deathList)

if getPlayerStorageValue(cid, config.storageTeamTwo) == 1 then

setPlayerStorageValue(cid, config.storageTeamTwo, 0)

setGlobalStorageValue(config.storageTeamTwo, getGlobalStorageValue(config.storageTeamTwo)-1)

else

setPlayerStorageValue(cid, config.storageteamOne, 0)

setGlobalStorageValue(config.storageteamOne, getGlobalStorageValue(config.storageteamOne)-1)

end

return true

end

 

function onLogout(cid)

if getPlayerStorageValue(cid, config.storageTeamTwo) == 1 then

setPlayerStorageValue(cid, config.storageTeamTwo, 0)

setGlobalStorageValue(config.storageTeamTwo, getGlobalStorageValue(config.storageTeamTwo)-1)

else

setPlayerStorageValue(cid, config.storageteamOne, 0)

setGlobalStorageValue(config.storageteamOne, getGlobalStorageValue(config.storageteamOne)-1)

end

return true

end

 

 

Vamos lá mais uma vez rs.

Link para o comentário
Compartilhar em outros sites

  • 0

e amigo nao deu ve se as tags estao certas

 

 

<event type="login" name="LoginTeam" event="script" value="loginTeam.lua"/>

<event type="logout" name="LogoutTeam" event="script" value="loginTeam.lua"/>

<event type="death" name="DeathTeam" event="script" value="loginTeam.lua"/>

 

o pior e que nao da erro no console

Editado por Rhamer
Link para o comentário
Compartilhar em outros sites

  • 0

nao

 

mas tipo bugou do nada ontem tava pegando 100% dai parou do nada vou ver isso

 

no caso seria isso ne

 

registerCreatureEvent(cid, "LogoutTeam")
registerCreatureEvent(cid, "DeathTeam")

 

man eu coloquei e deu na mesma

Editado por Rhamer
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...