SCRIPT DE TILE COM LIMITE

gustavohs1920
em Scripts

gustavohs1920

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 02/10/19Posts: 2

BOA PESSOAL! ESTOU CRIANDO UM OT SERVER E FIZ UMA HUNT FREE E DENTRO DA SALA TEM UM TILE QUE SUMMONA MONSTER AO PISAR EM CIMA, CERTO ATÉ AI TUDO BEM MAS PRECISO QUE NA SCRIPT DO TILE TENHA LIMITE DE MONSTER POR EXEMPLO ELE PASSA 30 VEZES EM CIMA E NA ULTIMA VEZ ELE SEJA TELEPORTADO PRA FORA DA HUNT.

~ OUTRA É UM TELEPORT QUE QUANDO O PLAYER TIVER DENTRO DA HUNT O OUTRO NAO PODERA ENTRAR 

SE ALGUEM PODER ME AJUDAR REP+ OBG VLW =D

wevertonvrb

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 21/05/13Posts: 303

vc não postou o script mas vou te ajudar em uma parte sobre pisar as 30x ainda estou aprendendo então vou usar muitas linhas mesmo sabendo que tem como fazer com nenos linhas, porem não me recordo de como fazer com menos linha

 

Spoiler

if getPlayerStorageValue(cid, 654564) < 31 then
--doCreateMonster("demon", toPosition, false) --- bota aqui o codigo pra fazer o bixo aparecer

return true

end

if getPlayerStorageValue(cid, 654564) < 1 then
setPlayerStorageValue(cid, 654564, 1) 

return true 

end

if getPlayerStorageValue(cid, 654564) == 1 then
setPlayerStorageValue(cid, 654564, 2) 

return true 

end

if getPlayerStorageValue(cid, 654564) == 2 then
setPlayerStorageValue(cid, 654564, 3) 

return true 

end

if getPlayerStorageValue(cid, 654564) == 3 then 
setPlayerStorageValue(cid, 654564, 4) 

return true 

end

--- vc vai copiando e colando isso e alterando 

--------

--------

--------

--- vc vai copiando e colando isso e alterando ate  chegar nesse ultimo que finalmente chega no 30 e 31 logo abaixo no caso vc tem q fazer ate o 29 pro 30

if getPlayerStorageValue(cid, 654564) == 30 then
setPlayerStorageValue(cid, 654564, 31) 

return true 

end
 

if getPlayerStorageValue(cid, 654564) == 31 then

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
sendMsgToPlayer(cid, 27, "coloque aqui a mensagem que ira aparecer pro jogador!")

return true 

end

 

Fjinst

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 26/04/08Posts: 251Gênero: MasculinoChar no Tibia: Senhor Mithril

Veja se funciona

não testei

SCRIPT de quando pisar no sqm sumonar bixo

function onStepIn(cid, item, fromPosition, toPosition, lastPosition)
local passos = 30
local storagepassos = 37824
local posicaoforadahunt = {x=000, y=000, z=0} --- aqui você define a posição onde será o fora da hunt
local criatura = "Demon" --- aqui vc define a criatura que sumonará
local mensagem = "Voce ja sumonou o maximo de criaturas na hunt, portanto sera teleportado para fora." --- aqui vc define a msg que vai aparecer qd tiver fora da hunt
if isPlayer(cid) then
if getPlayerStorageValue(cid, storagepassos) <= passos then
doCreateMonster(criatura, toPosition, false)
setPlayerStorageValue(cid, storagepassos, getPlayerStorageValue(cid, storagepassos)+1) 
doSendMagicEffect(toPosition,70)
else
doTeleportThing(cid, posicaoforadahunt)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, mensagem)
return true 

end
end
end

 

 

Script de checar se tem player na area

function onStepIn(cid, item, fromPosition, toPosition, lastPosition)

local from, to = {x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0} --- defina a posicao da quina < /\ e dps da quina > \/, ai ele vai checar se tem player na area, se tiver player na hunt ng entra, se não tiver, ele entra
  
	for x = from.x, to.x do
		for y = from.y, to.y do
			local n_pos = {x = x, y = y, z = from.z, stackpos = 255}
			local check = getThingFromPos(n_pos).uid

			if isPlayer(check) and getTopCreature(n_pos).uid >= 1 then
				doSendMagicEffect(getCreaturePosition(cid), 2)
				doTeleportThing(cid, lastPosition)
				return true
			end
		end
	end

	doSendMagicEffect(getCreaturePosition(cid), 12)
	return true
end

ps: creditos do script de checar se tem player na area @JoviM

I dont nothing to show, if u see this, sorry for you lose you time