Ir para conteúdo

[Encerrado] [Pedido] Script Elevador


GuhPk

Posts Recomendados

Olá pessoinhas, estou querendo se tem como criar um script, se tiver e alguém souber fazer... Por favor posta ai que dou uns rep's!!! xD

 

Como funciona:

 

O player entra em um local (elevador), e em uma parede terá um item que quando ele clicar irá abrir uma janela com algumas opções para ele selecionar...

Quando ele escolher 1, ele será teleportado para um local determinado.

 

Exemplo:

 

Cliquei no item apareceu a janela:

________________

|1º Andar - Entrada |

|2º Andar - Loja.......|

|_[Cancel]_[_Ok_]_|

 

Ai eu escolho o 2 andar e vou para x= 1000 y=1000 z=7...

Escolho a 1 vou para x=1000 y=1000 z=6

 

Tenderam??? xD Se fizer posta ai que vou recompensar!!!

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

oia mano.. o maximo q da pra fazer eh isso..

 

1* vai em XML/vocation.xml, e adicione isso la..

 

<vocation id="10" name="Elevador" description="a pokemon trainer" needpremium="0" gaincap="0" gainhp="40" gainmana="0" gainhpticks="2" gainhpamount="3" gainmanaticks="0" gainmanaamount="0" manamultiplier="1.1" attackspeed="-1" soulmax="251" gainsoulticks="-1" fromvoc="1">

<formula meleeDamage="0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>

<skill fist="1.0" club="1.0" sword="1.0" axe="1.0" distance="1.0" shielding="1.0" fishing="3.0" experience="1.0"/>

</vocation>

 

2* vai em XML/channels.xml, e adiciona isso la..

 

<channel id="22" name="1* andar - Entrada">

<vocation id="10"/>

</channel>

<channel id="23" name="2* andar - Lojas">

<vocation id="10"/>

</channel>

 

3* vai em actions/scripts/, cria um arquivo la com qlqr nome e cola isso nele..

 

function onUse(cid, item, frompos, item2, topos)

 

doPlayerSetVocation(cid, 10)

openChannelDialog(cid)

 

return true

end

 

tag do actions.xml, xxxx = id do item....

<action itemid="xxxx" event="script" value="NOME DO ARQUIVO.lua"/>

4* vai em creaturescripts/scripts/tvsys.lua, e adiciona isso la..

 

if channelId >= 22 and channelId <= 23 then

local teleport = {

[22] = {x=1045, y=1057, z=7}, --muda aki as posiçoes...

[23] = {x= 1059, y=1057, z=7},

}

doTeleportThing(cid, teleport[channelId])

doSendMagicEffect(getThingPos(cid), 21)

doPlayerSetVocation(cid, 1)

return false

end

 

 

 

Link para o comentário
Compartilhar em outros sites

Cara, eu fiz tudinho aqui, porém quando escolho 1 andar ou 2 andar... Não teleporta, e sim abre outra janela do chat!!!

 

Eu quero, que quando eu clique no item abra aquela janela mesmo (tirando o NPC que aparece)...

Porém, quero que quando eu escolha uma das opções eu seja teleportado para um certo local!! usaaushasu'

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

veio eu testei aki e deu tudo certo.. aonde exatamente vc colocou aqueles arquivos? ;x poste os scripts pra eu ver...

-e n tem como tirar o NPCs ali e nem o chat da guild ;/ -

 

qlqr coisa tenta mudar isso..

if channelId >= 22 and channelId <= 23 then

para isso..

if channelId == 22 or channelId == 23 then

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

Não sei local correto de colocar o script no tvsys.lua!! sauhsauhs'

Poderia colocar para mim ai???

 

 

 

 

function onJoinChannel(cid, channelId, users, isTv)

 

 

if channelId == 10 then

doShowPokemonStatistics(cid)

return false

end

 

if channelId == 11 then

if reloadHighscoresWhenUsingPc then

doReloadHighscores()

end

doPlayerPopupFYI(cid, getHighscoreString(8))

return false

end

 

if channelId == 12 then

if reloadHighscoresWhenUsingPc then

doReloadHighscores()

end

doPlayerPopupFYI(cid, getHighscoreString(6))

return false

end

--////////////////////////////////////////////////////////////////////////////////////////--

if channelId >= 13 and channelId <= 18 then

local sid = getPlayerByName(getPlayerStorageValue(cid, 52482))

local pokes1 = getLivePokeballs(cid, getPlayerSlotItem(cid, 3).uid) --alterado v2.6.1

local pokes2 = getLivePokeballs(sid, getPlayerSlotItem(sid, 3).uid)

if #pokes1 < (channelId-12) or (isCreature(sid) and #pokes2 < (channelId-12)) then

doPlayerSendTextMessage(cid, 20, "You or your opponent doesn't have that amount of pokemons in their bags! Duel are canceled!")

doPlayerSetVocation(cid, 1)

setPlayerStorageValue(cid, 52480, -1)

setPlayerStorageValue(cid, 6598754, -1) --alterado v2.6.1

setPlayerStorageValue(cid, 52482, -1)

setPlayerStorageValue(cid, 52483, -1)

doCreatureSetSkullType(cid, 0)

return false

end

 

doSendAnimatedText(getThingPos(cid), (channelId-12).." Poke"..(channelId > 13 and "s" or ""), COLOR_BURN)

setPlayerStorageValue(cid, 52481, (channelId-12))

if isCreature(sid) then

setPlayerStorageValue(sid, 52481, (channelId-12)) --alterado v2.6.1

doPlayerSendTextMessage(sid, 20, getCreatureName(cid).." is inviting you to a duel! Use order in him to accept it! You have 40segs to accept the invit.")

end

addEvent(endInviting, 40000, cid)

addEvent(doSendAnimatedText, 1000, getThingPos(cid), "BATTLE", COLOR_ELECTRIC)

doPlayerSetVocation(cid, 1)

return false

end

--////////////////////////////////////////////////////////////////////////////////////////--

 

if channelId >= 100 and channelId <= 10000 then

 

local owner = getPlayerByGUID(getChannelOwner(channelId))

 

if isChannelTv(channelId) then

if isCreature(owner) then

if owner ~= cid then

doPlayerWatchOther(cid, owner)

local plural = #users == 1 and "" or "s"

doPlayerSendChannelMessage(owner, "TV Channel", getCreatureName(cid)..' is now watching your channel (currently '..#users..' player'..plural..' watching this channel).', 15, channelId)

else

setPlayerStorageValue(cid, 99284, 1)

end

end

elseif owner == cid then

setPlayerStorageValue(cid, 99284, 2)

end

 

return true

end

 

return true

end

 

 

function onLeaveChannel(cid, channelId, users)

 

if channelId >= 100 and channelId <= 10000 then

 

local owner = getPlayerByGUID(getChannelOwner(channelId))

 

if isChannelTv(channelId) then

if owner ~= cid and getCreatureOutfit(cid).lookType == 814 then

doPlayerStopWatching(cid)

local plural = #users == 2 and "" or "s"

doPlayerSendChannelMessage(owner, "TV Channel", getCreatureName(cid)..' is not watching your channel anymore (currently '..#users - (1)..' player'..plural..' watching this channel).', 15, channelId)

elseif owner == cid then

setPlayerStorageValue(cid, 99284, -1)

doSendAnimatedText(getThingPos(cid), "CAM OFF", 180)

for stops = 1, #users do

if users[stops] ~= owner then

doPlayerStopWatching(users[stops])

end

end

end

elseif owner == cid then

setPlayerStorageValue(cid, 99284, -1)

end

 

return true

end

 

return true

end

 

function onWalk(cid, fromPosition, toPosition)

 

 

 

-- Código não é mais necessário, feito em c++

-- Code deprecated, made in c++

--if not canWalkOnPos(toPosition, false, false, false, true, false) and getPlayerStorageValue(cid, 17000) >= 1 then

-- doTeleportThing(cid, fromPosition, false)

-- doPlayerSendCancel(cid, "Sorry, not possible.")

--end

 

if getPlayerStorageValue(cid, 99284) <= 0 then return true end

 

local speed = getCreatureSpeed(cid)

local a = getWatchingPlayersFromPos(cid, fromPosition)

 

for b = 1, #a do

if getCreatureSpeed(a) ~= speed then

doChangeSpeed(a, - getCreatureSpeed(a))

doChangeSpeed(a, speed)

end

doTeleportThing(a, toPosition, true)

end

 

return true

end

 

local permited = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s",

"t", "u", "v", "x", "w", ",", "'", '"',

"y", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", ".", "!", "@", "#", "$", "%", "&", "*", "(", ")",

"-", "_", "+", "/", ";", ":", "?", "^", "~", "{", "[", "}", "]", ">", "<", "£", "¢", "¬"}

 

function onTextEdit(cid, item, newText)

 

if item.itemid == 12330 then

 

if getPlayerStorageValue(cid, 99284) >= 1 then

doPlayerSendCancel(cid, "You are already on air!")

return false

end

 

local channelName = getCreatureName(cid).."'s TV Channel"

 

if string.len(newText) <= 0 then

doPlayerSendCancel(cid, "Your channel is going to be shown as \""..getCreatureName(cid).."'s TV Channel\".")

elseif string.len(newText) > 25 then

doPlayerSendCancel(cid, "Your channel name can't have more than 25 characters.")

return false

else

channelName = newText

end

 

 

setPlayerStorageValue(cid, 99284, 1)

setPlayerStorageValue(cid, 99285, "")

setPlayerStorageValue(cid, 99285, channelName)

doPlayerCreatePrivateChannel(cid, channelName)

doSendAnimatedText(getThingPos(cid), "ON AIR!", COLOR_GRASS)

 

return false

end

 

 

Link para o comentário
Compartilhar em outros sites

 

function onJoinChannel(cid, channelId, users, isTv)

 

if channelId >= 22 and channelId <= 23 then

local teleport = {

[22] = {x=1045, y=1057, z=7}, --muda aki as posiçoes...

[23] = {x= 1059, y=1057, z=7},

}

doTeleportThing(cid, teleport[channelId])

doSendMagicEffect(getThingPos(cid), 21)

doPlayerSetVocation(cid, 1)

return false

end

 

if channelId == 10 then

doShowPokemonStatistics(cid)

return false

end

 

if channelId == 11 then

if reloadHighscoresWhenUsingPc then

doReloadHighscores()

end

doPlayerPopupFYI(cid, getHighscoreString(8))

return false

end

 

if channelId == 12 then

if reloadHighscoresWhenUsingPc then

doReloadHighscores()

end

doPlayerPopupFYI(cid, getHighscoreString(6))

return false

end

--////////////////////////////////////////////////////////////////////////////////////////--

if channelId >= 13 and channelId <= 18 then

local sid = getPlayerByName(getPlayerStorageValue(cid, 52482))

local pokes1 = getLivePokeballs(cid, getPlayerSlotItem(cid, 3).uid) --alterado v2.6.1

local pokes2 = getLivePokeballs(sid, getPlayerSlotItem(sid, 3).uid)

if #pokes1 < (channelId-12) or (isCreature(sid) and #pokes2 < (channelId-12)) then

doPlayerSendTextMessage(cid, 20, "You or your opponent doesn't have that amount of pokemons in their bags! Duel are canceled!")

doPlayerSetVocation(cid, 1)

setPlayerStorageValue(cid, 52480, -1)

setPlayerStorageValue(cid, 6598754, -1) --alterado v2.6.1

setPlayerStorageValue(cid, 52482, -1)

setPlayerStorageValue(cid, 52483, -1)

doCreatureSetSkullType(cid, 0)

return false

end

 

doSendAnimatedText(getThingPos(cid), (channelId-12).." Poke"..(channelId > 13 and "s" or ""), COLOR_BURN)

setPlayerStorageValue(cid, 52481, (channelId-12))

if isCreature(sid) then

setPlayerStorageValue(sid, 52481, (channelId-12)) --alterado v2.6.1

doPlayerSendTextMessage(sid, 20, getCreatureName(cid).." is inviting you to a duel! Use order in him to accept it! You have 40segs to accept the invit.")

end

addEvent(endInviting, 40000, cid)

addEvent(doSendAnimatedText, 1000, getThingPos(cid), "BATTLE", COLOR_ELECTRIC)

doPlayerSetVocation(cid, 1)

return false

end

--////////////////////////////////////////////////////////////////////////////////////////--

 

if channelId >= 100 and channelId <= 10000 then

 

local owner = getPlayerByGUID(getChannelOwner(channelId))

 

if isChannelTv(channelId) then

if isCreature(owner) then

if owner ~= cid then

doPlayerWatchOther(cid, owner)

local plural = #users == 1 and "" or "s"

doPlayerSendChannelMessage(owner, "TV Channel", getCreatureName(cid)..' is now watching your channel (currently '..#users..' player'..plural..' watching this channel).', 15, channelId)

else

setPlayerStorageValue(cid, 99284, 1)

end

end

elseif owner == cid then

setPlayerStorageValue(cid, 99284, 2)

end

 

return true

end

 

return true

end

 

 

function onLeaveChannel(cid, channelId, users)

 

if channelId >= 100 and channelId <= 10000 then

 

local owner = getPlayerByGUID(getChannelOwner(channelId))

 

if isChannelTv(channelId) then

if owner ~= cid and getCreatureOutfit(cid).lookType == 814 then

doPlayerStopWatching(cid)

local plural = #users == 2 and "" or "s"

doPlayerSendChannelMessage(owner, "TV Channel", getCreatureName(cid)..' is not watching your channel anymore (currently '..#users - (1)..' player'..plural..' watching this channel).', 15, channelId)

elseif owner == cid then

setPlayerStorageValue(cid, 99284, -1)

doSendAnimatedText(getThingPos(cid), "CAM OFF", 180)

for stops = 1, #users do

if users[stops] ~= owner then

doPlayerStopWatching(users[stops])

end

end

end

elseif owner == cid then

setPlayerStorageValue(cid, 99284, -1)

end

 

return true

end

 

return true

end

 

function onWalk(cid, fromPosition, toPosition)

 

 

 

-- Código não é mais necessário, feito em c++

-- Code deprecated, made in c++

--if not canWalkOnPos(toPosition, false, false, false, true, false) and getPlayerStorageValue(cid, 17000) >= 1 then

-- doTeleportThing(cid, fromPosition, false)

-- doPlayerSendCancel(cid, "Sorry, not possible.")

--end

 

if getPlayerStorageValue(cid, 99284) <= 0 then return true end

 

local speed = getCreatureSpeed(cid)

local a = getWatchingPlayersFromPos(cid, fromPosition)

 

for b = 1, #a do

if getCreatureSpeed(a) ~= speed then

doChangeSpeed(a, - getCreatureSpeed(a))

doChangeSpeed(a, speed)

end

doTeleportThing(a, toPosition, true)

end

 

return true

end

 

local permited = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s",

"t", "u", "v", "x", "w", ",", "'", '"',

"y", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", ".", "!", "@", "#", "$", "%", "&", "*", "(", ")",

"-", "_", "+", "/", ";", ":", "?", "^", "~", "{", "[", "}", "]", ">", "<", "£", "¢", "¬"}

 

function onTextEdit(cid, item, newText)

 

if item.itemid == 12330 then

 

if getPlayerStorageValue(cid, 99284) >= 1 then

doPlayerSendCancel(cid, "You are already on air!")

return false

end

 

local channelName = getCreatureName(cid).."'s TV Channel"

 

if string.len(newText) <= 0 then

doPlayerSendCancel(cid, "Your channel is going to be shown as \""..getCreatureName(cid).."'s TV Channel\".")

elseif string.len(newText) > 25 then

doPlayerSendCancel(cid, "Your channel name can't have more than 25 characters.")

return false

else

channelName = newText

end

 

 

setPlayerStorageValue(cid, 99284, 1)

setPlayerStorageValue(cid, 99285, "")

setPlayerStorageValue(cid, 99285, channelName)

doPlayerCreatePrivateChannel(cid, channelName)

doSendAnimatedText(getThingPos(cid), "ON AIR!", COLOR_GRASS)

 

return false

end

 

Link para o comentário
Compartilhar em outros sites

Deu esses erro's aqui :

 

 

 

 

[02/12/2012 12:30:34] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/tvsys.lua:178: 'end' expected (to close 'function' at line 150) near '<eof>'

[02/12/2012 12:30:34] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/tvsys.lua)

[02/12/2012 12:30:34] data/creaturescripts/scripts/tvsys.lua:178: 'end' expected (to close 'function' at line 150) near '<eof>'

[02/12/2012 12:30:34] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/tvsys.lua:178: 'end' expected (to close 'function' at line 150) near '<eof>'

[02/12/2012 12:30:34] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/tvsys.lua)

[02/12/2012 12:30:34] data/creaturescripts/scripts/tvsys.lua:178: 'end' expected (to close 'function' at line 150) near '<eof>'

[02/12/2012 12:30:34] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/tvsys.lua:178: 'end' expected (to close 'function' at line 150) near '<eof>'

[02/12/2012 12:30:34] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/tvsys.lua)

[02/12/2012 12:30:34] data/creaturescripts/scripts/tvsys.lua:178: 'end' expected (to close 'function' at line 150) near '<eof>'

[02/12/2012 12:30:34] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/tvsys.lua:178: 'end' expected (to close 'function' at line 150) near '<eof>'

[02/12/2012 12:30:34] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/tvsys.lua)

[02/12/2012 12:30:34] data/creaturescripts/scripts/tvsys.lua:178: 'end' expected (to close 'function' at line 150) near '<eof>'

 

 

 

E então não funcionou o system!! :(

Ta abrindo janela de chat ainda... ASSAJISAJISJ'

 

#Edited

 

Cara, tava pensando e tive uma ideia mais facil, será que teria um script de quando clicar em um na parede, o player é teleportado para um sala em uma pos configuravel??!!!

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

  • 5 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

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