Ir para conteúdo

Featured Replies

Postado

OTX 1.3

 

FUNCIONA ASSIM

 

-- O PLAYER USA O ITEM E CLICA NO TILE 

"OBS: SÓ PODE PZ"

-- 2 : O PLAYER FALA O COMANDO "!SEAL"

"OBS: APARECE UMA TELA MOSTRANDO OS LOCAL QUE ELE MARCOU COMO "LOCAL 1;LOCAL 2"

-- 3 : PLAYER FREE SÓ PODE MARCAR 5 LOCAIS,VIP PODE MARCAR 7

"OBS:SÓ PODE USAR QUANDO ESTIVER PZ"

-- 4 :SAI UM EFEITO AO TELEPORTAR,APARECE EM LARANJA "LOCAL ''1,2'' ETC"

"OBS:COLDOWN DE 25 SEGUNDOS PARA TELEPORTAR NOVAMENTE"

-- 5 SÓ PODE EM X VOCATION,E UM X ITEM

 

O rei de seu proprio destino é aquele que luta pela gloria do amanhã!
Discord : ZoR#9373


 

  • Respostas 6
  • Visualizações 346
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @ZikaLord Mano, aparentemente está funcionando. Tenta instalar esse script aqui: Em data/talkactions/talkactions.xml cole isto: <talkaction words="!seal" script="seals.lua" /> A

Postado

Não entendi muito bem, você quer fazer um item que cria um warp? Por exemplo, dá use no item e em uma posição X, depois dá use no item e em uma posição Y e depois quando clicar em X você vai pra Y e vice-versa?

O que você considera como "VIP" no seu servidor? Premmium ou StorageID?

Editado por marcot (veja o histórico de edições)

Postado
  • Autor
2 minutos atrás, marcot disse:

Não entendi muito bem, você quer fazer um item que cria um warp? Por exemplo, dá use no item e em uma posição X, depois dá use no item e em uma posição Y e depois quando clicar em X você vai pra Y e vice-versa?

O que você considera como "VIP" no seu servidor? Premmium ou StorageID?

 

exemplo,estou andando sobre a cave,achei um local ai nao quero perder esse local,ai pego o item X clico no tile e aparece "Local 1 Setado"

ai eu acabo morrendo e quero voltar no local,ai falo "!seal ''local 1'' ai aparece um efeito e eu teleporto de volta.

precisa estar fora de battle,tem um coldown pra usar,ao setar o local aparece um efeito.

pra saber os locais ele fala "!seal local" aparece uma tabela e mostra os local setado exemplo.

 

 

Local 1 -  Setado x = 453, y = 654, z = 7

Local 2 - Setado   x = 346, y = 574, z = 7

Local 3 - Nao existe

Local 4 - Nao existe

Local 5 - Nao existe

Local 6 - Nao existe

Local 7 - Nao Existe

O rei de seu proprio destino é aquele que luta pela gloria do amanhã!
Discord : ZoR#9373


 

Postado

@ZikaLord

Mano, aparentemente está funcionando. Tenta instalar esse script aqui:

Em data/talkactions/talkactions.xml cole isto:

<talkaction words="!seal" script="seals.lua" />

Agora vá para data/talkactions/scripts e crie um arquivo chamado seals.lua. Dentro dele cole:

local config = {
	maxSeals = 7	
}

function onSay(cid, words, param)
	local parametros = mysplit(param, " ")
	if #parametros == 1 then
		if parametros[1] == "local" then
			return showSeals (cid)
		else
			return 0
		end
	elseif #parametros == 2 then
		number = tonumber(parametros[2])
		if number > 7 then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Selo invalido.")
			return TRUE
		end
		if number > 5 and isPremium (cid) then
			return teleportPlayerToSeal (cid, number)
		else if number <= 5 then
			return teleportPlayerToSeal (cid, number)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce precisa ser premmy para ter acesso as duas ultimas posicoes.")
		end
	end
	return TRUE
end
end
function showSeals (cid)
	local file = io.open ("./data/talkactions/scripts/seals/"..getPlayerName(cid) .. ".txt", "r")
	if file == nil then
		doShowTextDialog(cid, 2333, "Nenhum local marcado.")
		return TRUE
	end
	qt = tonumber(file:read("*l"))
	locations = {}
	for i=1, qt do
		locations[i] = {x = tonumber(file:read("*l")), 
		                y = tonumber(file:read("*l")), 
		                z = tonumber(file:read("*l"))}
	end
	text = createLocationString ( locations )
	doShowTextDialog(cid, 2333, text)
	return TRUE
end

function teleportPlayerToSeal(cid, number)
	local file = io.open ("./data/talkactions/scripts/seals/"..getPlayerName(cid) .. ".txt", "r")
	if file == nil then
		doShowTextDialog(cid, 2333, "Nenhum local marcado.")
		return TRUE
	end
	qt = tonumber(file:read("*l"))
	locations = {}
	for i=1, qt do
		locations[i] = {x = tonumber(file:read("*l")), 
		                y = tonumber(file:read("*l")), 
		                z = tonumber(file:read("*l"))}
	end
	doSendMagicEffect (getPlayerPosition(cid), 2)
	doTeleportThing (cid, locations[number], false)
	doSendMagicEffect (getPlayerPosition(cid), 2)
	file:close()
	return TRUE
end

function createLocationString ( locations )
	string = ""
	for i = 1, config.maxSeals do
		if locations[i] == nil then
			string = string .. "Local ".. i .. " - Nao existe\n" 
		else
			string = string .. "Local ".. i .. " - " .. "Setado x = " .. locations[i].x .. ", y = " .. locations[i].y .. ", z = " .. locations[i].z .. "\n"
		end
	end
	return string
end

function mysplit(inputstr, sep)
        if sep == nil then
                sep = "%s"
        end
        local t={} ; i=1
        for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
                t[i] = str
                i = i + 1
        end
        return t
end

Agora vá para data/actions/actions.xml e cole:

<action itemid="XXXX" event="script" value="seal.lua" allowfaruse = "1" />

Onde XXXX é o ID do item que você vai usar para setar as posições.

 

Agora vá em data/actions/scripts, crie um seal.lua e cole dentro dele:

function onUse(cid, item, fromPosition, itemEx, toPosition)
	file1 = io.open ("./data/talkactions/scripts/seals/"..getPlayerName(cid) .. ".txt", "r")
	locations = {}
	qt = 0
	if file1 == nil then
		qt = 0
	else
		qt = tonumber(file1:read("*l"))
		for i=1, qt do
			locations[i] = {x = tonumber(file1:read("*l")), 
			                y = tonumber(file1:read("*l")), 
			                z = tonumber(file1:read("*l"))}
		end
		file1:close()
	end
	
	if qt > 7 then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Maximo de selos atingidos.")
		return TRUE
	end

	local pos = toPosition
	locations[qt + 1] = {x = pos.x, y = pos.y, z = pos.z}
	local file = io.open ("./data/talkactions/scripts/seals/"..getPlayerName(cid) .. ".txt", "w")
	io.output(file)
	io.write(qt+1 .. "\n")
	for i=1, qt+1 do
		io.write(locations[i].x .. "\n" .. locations[i].y .. "\n" .. locations[i].z .. "\n")
	end
	file:close()
	return TRUE
end

Não tem cooldown porque esse é o primeiro script que faço em 8.6, daí não sei como o pessoal faz.

 

[EDIT]

Desculpa, esqueci de colocar o negocio da vocation, mas e so mexer no talkaction colocando um getPlayerVocation(cid) == X

Editado por marcot (veja o histórico de edições)

Postado
  • Autor
23 horas atrás, marcot disse:

@ZikaLord

Mano, aparentemente está funcionando. Tenta instalar esse script aqui:

Em data/talkactions/talkactions.xml cole isto:


<talkaction words="!seal" script="seals.lua" />

Agora vá para data/talkactions/scripts e crie um arquivo chamado seals.lua. Dentro dele cole:


local config = {
	maxSeals = 7	
}

function onSay(cid, words, param)
	local parametros = mysplit(param, " ")
	if #parametros == 1 then
		if parametros[1] == "local" then
			return showSeals (cid)
		else
			return 0
		end
	elseif #parametros == 2 then
		number = tonumber(parametros[2])
		if number > 7 then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Selo invalido.")
			return TRUE
		end
		if number > 5 and isPremium (cid) then
			return teleportPlayerToSeal (cid, number)
		else if number <= 5 then
			return teleportPlayerToSeal (cid, number)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce precisa ser premmy para ter acesso as duas ultimas posicoes.")
		end
	end
	return TRUE
end
end
function showSeals (cid)
	local file = io.open ("./data/talkactions/scripts/seals/"..getPlayerName(cid) .. ".txt", "r")
	if file == nil then
		doShowTextDialog(cid, 2333, "Nenhum local marcado.")
		return TRUE
	end
	qt = tonumber(file:read("*l"))
	locations = {}
	for i=1, qt do
		locations[i] = {x = tonumber(file:read("*l")), 
		                y = tonumber(file:read("*l")), 
		                z = tonumber(file:read("*l"))}
	end
	text = createLocationString ( locations )
	doShowTextDialog(cid, 2333, text)
	return TRUE
end

function teleportPlayerToSeal(cid, number)
	local file = io.open ("./data/talkactions/scripts/seals/"..getPlayerName(cid) .. ".txt", "r")
	if file == nil then
		doShowTextDialog(cid, 2333, "Nenhum local marcado.")
		return TRUE
	end
	qt = tonumber(file:read("*l"))
	locations = {}
	for i=1, qt do
		locations[i] = {x = tonumber(file:read("*l")), 
		                y = tonumber(file:read("*l")), 
		                z = tonumber(file:read("*l"))}
	end
	doSendMagicEffect (getPlayerPosition(cid), 2)
	doTeleportThing (cid, locations[number], false)
	doSendMagicEffect (getPlayerPosition(cid), 2)
	file:close()
	return TRUE
end

function createLocationString ( locations )
	string = ""
	for i = 1, config.maxSeals do
		if locations[i] == nil then
			string = string .. "Local ".. i .. " - Nao existe\n" 
		else
			string = string .. "Local ".. i .. " - " .. "Setado x = " .. locations[i].x .. ", y = " .. locations[i].y .. ", z = " .. locations[i].z .. "\n"
		end
	end
	return string
end

function mysplit(inputstr, sep)
        if sep == nil then
                sep = "%s"
        end
        local t={} ; i=1
        for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
                t[i] = str
                i = i + 1
        end
        return t
end

Agora vá para data/actions/actions.xml e cole:


<action itemid="XXXX" event="script" value="seal.lua" allowfaruse = "1" />

Onde XXXX é o ID do item que você vai usar para setar as posições.

 

Agora vá em data/actions/scripts, crie um seal.lua e cole dentro dele:


function onUse(cid, item, fromPosition, itemEx, toPosition)
	file1 = io.open ("./data/talkactions/scripts/seals/"..getPlayerName(cid) .. ".txt", "r")
	locations = {}
	qt = 0
	if file1 == nil then
		qt = 0
	else
		qt = tonumber(file1:read("*l"))
		for i=1, qt do
			locations[i] = {x = tonumber(file1:read("*l")), 
			                y = tonumber(file1:read("*l")), 
			                z = tonumber(file1:read("*l"))}
		end
		file1:close()
	end
	
	if qt > 7 then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Maximo de selos atingidos.")
		return TRUE
	end

	local pos = toPosition
	locations[qt + 1] = {x = pos.x, y = pos.y, z = pos.z}
	local file = io.open ("./data/talkactions/scripts/seals/"..getPlayerName(cid) .. ".txt", "w")
	io.output(file)
	io.write(qt+1 .. "\n")
	for i=1, qt+1 do
		io.write(locations[i].x .. "\n" .. locations[i].y .. "\n" .. locations[i].z .. "\n")
	end
	file:close()
	return TRUE
end

Não tem cooldown porque esse é o primeiro script que faço em 8.6, daí não sei como o pessoal faz.

 

[EDIT]

Desculpa, esqueci de colocar o negocio da vocation, mas e so mexer no talkaction colocando um getPlayerVocation(cid) == X

 

Lua Script Error: [Action Interface]
(Unknown scriptfile)
attempt to call a nil value
stack traceback:
        [C]: at 0x00d02d10

esse script é de Tfs 1.3 OTX?

O rei de seu proprio destino é aquele que luta pela gloria do amanhã!
Discord : ZoR#9373


 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo