Você chega se eles tem storage da mesma forma ué.
player = getTopCreature({x = x, y = y, z = z}).uid
if getPlayerStorageValue(player, STORAGE) == 1 then
By UroTTa, 21 de abr. de 2014 in Archived
info
Group: Marquês
Joined: 02/08/12
Posts: 1k
Reputation: +234
Tibia Character: Maurolkit

Você chega se eles tem storage da mesma forma ué.
player = getTopCreature({x = x, y = y, z = z}).uid
if getPlayerStorageValue(player, STORAGE) == 1 then
@EDITED: Ajudando skype
Edited Abril 21 by Techrlz
info
Group: Campones
Joined: 13/01/12
Posts: 31
Reputation: +6
Tibia Character: Lost Woods

@Techrlz
Não funcionou.
@Skymagnum
Você não entendeu, esse script que eu postei era para funcionar so quando 4 jogadores pisase em seus respectivos tiles, mas so de 1 ja pisar o script executa as funções.
@Alguem ajuda?
Edited Abril 21 by UroTTa
Deixa variavel start inicialmente como true, e caso algum nao possa seta como false, do jeito que ta fazendo se acha um estiver já seta como true
info
Group: Infante
Joined: 13/10/08
Posts: 1.6k
Reputation: +420
Tibia Character: Demonbholder

Isso?
start = 0 if item.actionid == 8014 then for i = 1, 4 do local creature = getTopCreature(pos[i]).uid if creature > 0 then if isPlayer(creature) then if getGlobalStorageValue(8014) < 1 then if getPlayerStorageValue(creature, 1050) == 19 then doCreatureSay(creature, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1) start = start + 1 end end end end end if start == 4 then
Edited Abril 21 by Demonbholder
info
Group: Campones
Joined: 13/01/12
Posts: 31
Reputation: +6
Tibia Character: Lost Woods

@Demonbholder
Não deu, apenas 1 ja continua fazendo o efeito no tile.
info
Group: Infante
Joined: 13/10/08
Posts: 1.6k
Reputation: +420
Tibia Character: Demonbholder

Copiou tudo que eu coloquei ali mesmo? Até o start = 0 e if start == 4? O código fica assim:
local pos = {
{x = 33258, y = 31079, z = 8},
{x = 33259, y = 31089, z = 8},
{x = 33266, y = 31084, z = 8},
{x = 33263, y = 31093, z = 8}
}
function doClearMissionArea(fromPos, toPos)
for x = fromPos.x, toPos.x do
for y = fromPos.y, toPos.y do
for z = fromPos.z, toPos.z do
if(getTopCreature({x = x, y = y, z = z}).uid > 0) then
if(isPlayer(getTopCreature({x = x, y = y, z = z}).uid)) then
doTeleportThing(getTopCreature({x = x, y = y, z = z}).uid, {x = 33353, y = 31410, z = 8})
doSendMagicEffect({x = 33353, y = 31410, z = 8}, CONST_ME_TELEPORT)
else
doRemoveCreature(getTopCreature({x = x, y = y, z = z}).uid)
end
end
end
end
end
return true
end
function TirarEscada()
local escada = getTileItemById({x = 33265, y = 31116, z = 8}, 3687)
local escada2 = getTileItemById({x = 33265, y = 31116, z = 7}, 3219)
if escada then
doRemoveItem(escada.uid, 1)
doRemoveItem(escada2.uid, 1)
doCreateItem(11097, 1, {x = 33265, y = 31116, z = 7})
end
return true
end
function onStepIn(cid, item, position, lastPosition)
start = 0
if item.actionid == 8014 then
for i = 1, 4 do
local creature = getTopCreature(pos[i]).uid
if creature > 0 then
if isPlayer(creature) then
if getGlobalStorageValue(8014) < 1 then
if getPlayerStorageValue(creature, 1050) == 19 then
doCreatureSay(creature, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1)
start = start + 1
end
end
end
end
end
if start == 4 then
doCreateItem(3687, 1, {x = 33265, y = 31116, z = 8})
doCreateItem(3219, 1, {x = 33265, y = 31116, z = 7})
addEvent(TirarEscada, 30 * 1000)
setGlobalStorageValue(8014, 1)
addEvent(setGlobalStorageValue, 8014, 0)
creature = ""
for k = 1, 4 do
for j = 1, 20 do
if(k < 3) then
creature = "eternal guardian"
else
creature = "lizard chosen"
end
summonPos = {x = math.random(33239, 33295), y = math.random(31100, 31132), z = 7}
addEvent(doSummonCreature, k * 30 * 1000, creature, summonPos)
addEvent(doSendMagicEffect, k * 30 * 1000, summonPos, CONST_ME_TELEPORT)
end
end
addEvent(doClearMissionArea, 5 * 30 * 1000, {x = 33239, y = 31100, z = 7}, {x = 33295, y = 31132, z = 7})
addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 15335, 2)
addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 1050, 20)
end
end
return true
end
ps: eu não to testando, mas acho que deve funcionar...
info
Group: Campones
Joined: 13/01/12
Posts: 31
Reputation: +6
Tibia Character: Lost Woods

Copiei e não deu ![]()
.
Edited Abril 21 by Techrlz
wtf HIEHEIHE
rachei dos parenteses kk, como se tivesse mais de uma condicional ai ne kk
ai ai
info
Group: Campones
Joined: 13/01/12
Posts: 31
Reputation: +6
Tibia Character: Lost Woods

Alem de ficar criticando porque não tenta me ajudar @dalvorsn
info
Group: Infante
Joined: 13/10/08
Posts: 1.6k
Reputation: +420
Tibia Character: Demonbholder

hahaha, com ou sem parênteses, nesse caso, da no mesmo kkkk
...
Edited Abril 21 by Demonbholder
hahaha, com ou sem parênteses, nesse caso, da no mesmo kkkk
enfim, tenta assim cara:
local pos = { {x = 33258, y = 31079, z = 8}, {x = 33259, y = 31089, z = 8}, {x = 33266, y = 31084, z = 8}, {x = 33263, y = 31093, z = 8} } function doClearMissionArea(fromPos, toPos) for x = fromPos.x, toPos.x do for y = fromPos.y, toPos.y do for z = fromPos.z, toPos.z do if(getTopCreature({x = x, y = y, z = z}).uid > 0) then if(isPlayer(getTopCreature({x = x, y = y, z = z}).uid)) then doTeleportThing(getTopCreature({x = x, y = y, z = z}).uid, {x = 33353, y = 31410, z = 8}) doSendMagicEffect({x = 33353, y = 31410, z = 8}, CONST_ME_TELEPORT) else doRemoveCreature(getTopCreature({x = x, y = y, z = z}).uid) end end end end end return true end function TirarEscada() local escada = getTileItemById({x = 33265, y = 31116, z = 8}, 3687) local escada2 = getTileItemById({x = 33265, y = 31116, z = 7}, 3219) if escada then doRemoveItem(escada.uid, 1) doRemoveItem(escada2.uid, 1) doCreateItem(11097, 1, {x = 33265, y = 31116, z = 7}) end return true end function onStepIn(cid, item, position, lastPosition) start = 0 if item.actionid == 8014 then for i = 1, 4 do pos[i].stackpos = 253 local creature = getThingFromPos(pos[i]).uid if creature > 0 then if isPlayer(creature) then if getGlobalStorageValue(8014) < 1 then if getPlayerStorageValue(creature, 1050) == 19 then doCreatureSay(creature, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1) start = start + 1 end end end end end if start == 4 then doCreateItem(3687, 1, {x = 33265, y = 31116, z = 8}) doCreateItem(3219, 1, {x = 33265, y = 31116, z = 7}) addEvent(TirarEscada, 30 * 1000) setGlobalStorageValue(8014, 1) addEvent(setGlobalStorageValue, 8014, 0) creature = "" for k = 1, 4 do for j = 1, 20 do if(k < 3) then creature = "eternal guardian" else creature = "lizard chosen" end summonPos = {x = math.random(33239, 33295), y = math.random(31100, 31132), z = 7} addEvent(doSummonCreature, k * 30 * 1000, creature, summonPos) addEvent(doSendMagicEffect, k * 30 * 1000, summonPos, CONST_ME_TELEPORT) end end addEvent(doClearMissionArea, 5 * 30 * 1000, {x = 33239, y = 31100, z = 7}, {x = 33295, y = 31132, z = 7}) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 15335, 2) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 1050, 20) end end return true end
Eu troquei uma função ali que vc tava usando por getThingFromPos.
Como eu disse, não to testando, mas sei lá, eu nunca tinha usado essa função getTopCreature, então troquei, de repente é isso...
Essa função getThingFromPos nem existe em tfs 1.0 o certo e usar getTopCreature mesmo.
info
Group: Campones
Joined: 13/01/12
Posts: 31
Reputation: +6
Tibia Character: Lost Woods
Gostaria de uma pequena ajuda em um script de movements de uma quest que estou fazendo, é o seguinte:
E uma quest que 4 jogadores pisam em um tile é abre uma escada ao sul, eu consegui fazer tudo, porem quando somente um jogador pisa ja abre a escada e executa suas funções. Gostaria que somente quando os 4 jogadores com tal storage executava as funções.
local pos = { {x = 33258, y = 31079, z = 8}, {x = 33259, y = 31089, z = 8}, {x = 33266, y = 31084, z = 8}, {x = 33263, y = 31093, z = 8} } function doClearMissionArea(fromPos, toPos) for x = fromPos.x, toPos.x do for y = fromPos.y, toPos.y do for z = fromPos.z, toPos.z do if(getTopCreature({x = x, y = y, z = z}).uid > 0) then if(isPlayer(getTopCreature({x = x, y = y, z = z}).uid)) then doTeleportThing(getTopCreature({x = x, y = y, z = z}).uid, {x = 33353, y = 31410, z = 8}) doSendMagicEffect({x = 33353, y = 31410, z = 8}, CONST_ME_TELEPORT) else doRemoveCreature(getTopCreature({x = x, y = y, z = z}).uid) end end end end end return true end function TirarEscada() local escada = getTileItemById({x = 33265, y = 31116, z = 8}, 3687) local escada2 = getTileItemById({x = 33265, y = 31116, z = 7}, 3219) if escada then doRemoveItem(escada.uid, 1) doRemoveItem(escada2.uid, 1) doCreateItem(11097, 1, {x = 33265, y = 31116, z = 7}) end return true end function onStepIn(cid, item, position, lastPosition) start = false if(getPlayerStorageValue(cid, 1050) == 19) then if(item.actionid == 8014) then for i = 1, 4 do if(getTopCreature(pos[i]).uid > 0) then if(isPlayer(getTopCreature(pos[i]).uid)) then if(getGlobalStorageValue(8014) < 1) then doCreatureSay(getTopCreature(pos[i]).uid, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1) start = true end end end end if(start == true) then doCreateItem(3687, 1, {x = 33265, y = 31116, z = 8}) doCreateItem(3219, 1, {x = 33265, y = 31116, z = 7}) addEvent(TirarEscada, 30 * 1000) setGlobalStorageValue(8014, 1) addEvent(setGlobalStorageValue, 8014, 0) creature = "" for k = 1, 4 do for j = 1, 20 do if(k < 3) then creature = "eternal guardian" else creature = "lizard chosen" end summonPos = {x = math.random(33239, 33295), y = math.random(31100, 31132), z = 7} addEvent(doSummonCreature, k * 30 * 1000, creature, summonPos) addEvent(doSendMagicEffect, k * 30 * 1000, summonPos, CONST_ME_TELEPORT) end end addEvent(doClearMissionArea, 5 * 30 * 1000, {x = 33239, y = 31100, z = 7}, {x = 33295, y = 31132, z = 7}) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 15335, 2) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 1050, 20) end end end return true end