Precisa do script ainda?
Help - Action de Teleporte se estiver com x oufit e bebado!
Por sisifos, 25 de jan. de 2019 em Scripts
info
Grupo: Colaborador
Registrado: 27/12/10
Posts: 271
Reputação: +87
Gênero: Masculino

Sim amigo, ainda preciso muito do Script!
info
Grupo: Colaborador
Registrado: 27/12/10
Posts: 271
Reputação: +87
Gênero: Masculino

function onUse(cid, item, frompos, item2, topos) local outfit = getCreatureOutfit(cid) -- IDS DOS ITENS --- itemidum = 2199 itemiddois = 9931 itemidtres = 5878 itemidquatro = 2503 questlevel = 140 --- POSS DOS ITENS --- garlicp1 = {x=85, y=333, z=7, stackpos=1} garlicp2 = {x=86, y=333, z=7, stackpos=1} garlicp3 = {x=87, y=333, z=7, stackpos=1} garlicp4 = {x=88, y=333, z=7, stackpos=1} --- POSSO PARA ONDE OS PLAYER VAI --- local newposs = {x=87, y=331, z=7} --- NÃO MEXER ! -- garlic1 = getThingfromPos(garlicp1) garlic2 = getThingfromPos(garlicp2) garlic3 = getThingfromPos(garlicp3) garlic4 = getThingfromPos(garlicp4) --- POSS DOS PLAYERS player1pos = {x=87, y=332, z=7, stackpos=253} player1 = getThingfromPos(player1pos) player2pos = {x=88, y=332, z=7, stackpos=253} player2 = getThingfromPos(player2pos) player3pos = {x=89, y=332, z=7, stackpos=253} player3 = getThingfromPos(player3pos) player4pos = {x=90, y=332, z=7, stackpos=253} player4 = getThingfromPos(player4pos) ---- NÃO MEXA --- knightvoc = getPlayerVocation(player1.uid) sorcvoc = getPlayerVocation(player2.uid) druidvoc = getPlayerVocation(player3.uid) paladinvoc = getPlayerVocation(player4.uid) --- NÃO MEXA --- player1level = getPlayerLevel(player1.uid) player2level = getPlayerLevel(player2.uid) player3level = getPlayerLevel(player3.uid) player4level = getPlayerLevel(player4.uid) if knightvoc == 4 or knightvoc == 8 and paladinvoc == 3 or paladinvoc == 7 and druidvoc == 2 or druidvoc == 6 and sorcvoc == 1 or sorcvoc == 5 then if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then if player1level >= questlevel and player2level >= questlevel and player3level >= questlevel and player4level >= questlevel then if item.itemid == 790 and garlic1.itemid == itemidum and garlic2.itemid == itemiddois and garlic3.itemid == itemidtres and garlic4.itemid == itemidquatro and getCreatureCondition(cid, CONDITION_DRUNK) and outfit.lookType == 21 then doRemoveItem(garlic1.uid,1) doRemoveItem(garlic2.uid,1) doRemoveItem(garlic3.uid,1) doRemoveItem(garlic4.uid,1) doTeleportThing(player1.uid,newposs) doSendMagicEffect(newposs,10) doTeleportThing(player2.uid,newposs) doSendMagicEffect(newposs,10) doTeleportThing(player3.uid,newposs) doSendMagicEffect(newposs,10) doTeleportThing(player4.uid,newposs) doSendMagicEffect(newposs,10) end else return 0 end else doPlayerSendCancel(cid,"Sorry, all players in your team must to be level " .. questlevel .. " drunk and transformed into rats or, all 4 players must be on right positions.") end end return 1 end
<action itemid="ID_ALAVANCA" event="script" value="NOMEDOARQUIVO.lua"/>
Editado Janeiro 29 por Pinpao
noossa brother, muito obrigado!
vou testar já e já te dou um feedback!
info
Grupo: Colaborador
Registrado: 27/12/10
Posts: 271
Reputação: +87
Gênero: Masculino

Ok
Oi amigo, beleza?
Eu acabei de testar o script, coloquei uniqueid na alavanca.
configurei os itens a serem sacrificados, e as posições que devem ser teleportados.
Más os script não funcionou, ele não acusou erro nenhum na distro, porém quando eu clico na alavanca, nada acontece,
não aparece mensagem nenhuma, como se não tivesse instalado, saberia me ajudar?
----
Adicionei o ID da alavanca no Action ID
A alavanca não se meche, mas aparece o seguinte código:
[Error - Action Interface]
data/actions/scripts/startserpentine.lua:onUse
Description:
(internalGetPlayerInfo) Player not found when requesting player info #6
[Error - Action Interface]
data/actions/scripts/startserpentine.lua:onUse
Description:
(internalGetPlayerInfo) Player not found when requesting player info #3
[Error - Action Interface]
data/actions/scripts/startserpentine.lua:onUse
Description:
(internalGetPlayerInfo) Player not found when requesting player info #3
[Error - Action Interface]
data/actions/scripts/startserpentine.lua:onUse
Description:
(luaGetThingFromPosition) Tile not found
Editado Janeiro 29 por sisifos
info
Grupo: Colaborador
Registrado: 27/12/10
Posts: 271
Reputação: +87
Gênero: Masculino

É que na verdade testei o script sem unique id e sem alavanca, testei em um item qualquer, acabei esquecendo de mudar, testa ai :
function onUse(cid, item, frompos, item2, topos) local outfit = getCreatureOutfit(cid) -- IDS DOS ITENS --- itemidum = 2199 itemiddois = 9931 itemidtres = 5878 itemidquatro = 2503 questlevel = 140 switchUniqueID = 1912 -- unique id da alavanca --- POSS DOS ITENS --- garlicp1 = {x=85, y=333, z=7, stackpos=1} garlicp2 = {x=86, y=333, z=7, stackpos=1} garlicp3 = {x=87, y=333, z=7, stackpos=1} garlicp4 = {x=88, y=333, z=7, stackpos=1} --- POSSO PARA ONDE OS PLAYER VAI --- local newposs = {x=87, y=331, z=7} --- NÃO MEXER ! -- garlic1 = getThingfromPos(garlicp1) garlic2 = getThingfromPos(garlicp2) garlic3 = getThingfromPos(garlicp3) garlic4 = getThingfromPos(garlicp4) --- POSS DOS PLAYERS player1pos = {x=87, y=332, z=7, stackpos=253} player1 = getThingfromPos(player1pos) player2pos = {x=88, y=332, z=7, stackpos=253} player2 = getThingfromPos(player2pos) player3pos = {x=89, y=332, z=7, stackpos=253} player3 = getThingfromPos(player3pos) player4pos = {x=90, y=332, z=7, stackpos=253} player4 = getThingfromPos(player4pos) ---- NÃO MEXA --- knightvoc = getPlayerVocation(player1.uid) sorcvoc = getPlayerVocation(player2.uid) druidvoc = getPlayerVocation(player3.uid) paladinvoc = getPlayerVocation(player4.uid) --- NÃO MEXA --- player1level = getPlayerLevel(player1.uid) player2level = getPlayerLevel(player2.uid) player3level = getPlayerLevel(player3.uid) player4level = getPlayerLevel(player4.uid) if knightvoc == 4 or knightvoc == 8 and paladinvoc == 3 or paladinvoc == 7 and druidvoc == 2 or druidvoc == 6 and sorcvoc == 1 or sorcvoc == 5 then if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then if player1level >= questlevel and player2level >= questlevel and player3level >= questlevel and player4level >= questlevel then if item.uid == switchUniqueID and garlic1.itemid == itemidum and garlic2.itemid == itemiddois and garlic3.itemid == itemidtres and garlic4.itemid == itemidquatro and getCreatureCondition(cid, CONDITION_DRUNK) and outfit.lookType == 21 then doRemoveItem(garlic1.uid,1) doRemoveItem(garlic2.uid,1) doRemoveItem(garlic3.uid,1) doRemoveItem(garlic4.uid,1) doTeleportThing(player1.uid,newposs) doSendMagicEffect(newposs,10) doTeleportThing(player2.uid,newposs) doSendMagicEffect(newposs,10) doTeleportThing(player3.uid,newposs) doSendMagicEffect(newposs,10) doTeleportThing(player4.uid,newposs) doSendMagicEffect(newposs,10) end else return 0 end else doPlayerSendCancel(cid,"Sorry, all players in your team must to be level " .. questlevel .. " drunk and transformed into rats or, all 4 players must be on right positions.") end end return 1 end
O uniqueid da alavanca que usei no script é "1912", mas se quiser muda é so mudar ali em "switchUniqueID", o script so vai funcionar se estiver com os 4 jogadores level 140+ um de cada vocação nas posições certas com os itens na poss certa e com utevo res ina "rat e bebados, caso contrario não, acabei de testar aqui e funcionou ^^
Boa noite amigo,
agradeço muito pela sua atenção, eu testei o código, copiei e colei, sem trocar para meus ids, porém quando fui abrir apareceu a seguinte mensagem:
>>> Loading actions... [Error - LuaInterface::loadFile] data/actions/scripts/startserpentine.lua:2: '=' expected near '�'
[Error - Event::checkScript] Cannot load script (data/actions/scripts/startserpentine.lua)
data/actions/scripts/startserpentine.lua:2: '=' expected near '�'
Copiei, colei seu código de novo, e alterei apenas os itens e locais de teleport, mas não funcionou e deu o mesmo erro.
Procurei muito, onde estava o erro mas nao consegui encontrar.
Esse abaixo, é o seu codigo com meus ids e localizações:
Citarfunction onUse(cid, item, frompos, item2, topos)
local outfit = getCreatureOutfit(cid)-- IDS DOS ITENS ---
itemidum = 6215
itemiddois = 6216
itemidtres = 6217
itemidquatro = 6218
questlevel = 140switchUniqueID = 1912 -- unique id da alavanca
--- POSS DOS ITENS ---
garlicp1 = {x=33143, y=32871, z=9, stackpos=1}
garlicp2 = {x=33146, y=32871, z=9, stackpos=1}
garlicp3 = {x=33149, y=32871, z=9, stackpos=1}
garlicp4 = {x=33152, y=32871, z=9, stackpos=1}
--- POSSO PARA ONDE OS PLAYER VAI ---
local newposs = {x=33127, y=32490, z=9}
--- NÃO MEXER ! --
garlic1 = getThingfromPos(garlicp1)
garlic2 = getThingfromPos(garlicp2)
garlic3 = getThingfromPos(garlicp3)
garlic4 = getThingfromPos(garlicp4)
--- POSS DOS PLAYERS
player1pos = {x=33145, y=32864, z=9, stackpos=253}
player1 = getThingfromPos(player1pos)
player2pos = {x=33146, y=32864, z=9, stackpos=253}
player2 = getThingfromPos(player2pos)
player3pos = {x=33147, y=32864, z=9, stackpos=253}
player3 = getThingfromPos(player3pos)
player4pos = {x=33148, y=32864, z=9, stackpos=253}
player4 = getThingfromPos(player4pos)
---- NÃO MEXA ---
knightvoc = getPlayerVocation(player1.uid)
sorcvoc = getPlayerVocation(player2.uid)
druidvoc = getPlayerVocation(player3.uid)
paladinvoc = getPlayerVocation(player4.uid)--- NÃO MEXA ---
player1level = getPlayerLevel(player1.uid)
player2level = getPlayerLevel(player2.uid)
player3level = getPlayerLevel(player3.uid)
player4level = getPlayerLevel(player4.uid)if knightvoc == 4 or knightvoc == 8 and
paladinvoc == 3 or paladinvoc == 7 and
druidvoc == 2 or druidvoc == 6 and
sorcvoc == 1 or sorcvoc == 5 then
if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then
if player1level >= questlevel and player2level >= questlevel and player3level >= questlevel and player4level >= questlevel then
if item.uid == switchUniqueID and garlic1.itemid == itemidum and garlic2.itemid == itemiddois and garlic3.itemid == itemidtres and garlic4.itemid == itemidquatro and getCreatureCondition(cid, CONDITION_DRUNK) and outfit.lookType == 21 then
doRemoveItem(garlic1.uid,1)
doRemoveItem(garlic2.uid,1)
doRemoveItem(garlic3.uid,1)
doRemoveItem(garlic4.uid,1)doTeleportThing(player1.uid,newposs)
doSendMagicEffect(newposs,10)doTeleportThing(player2.uid,newposs)
doSendMagicEffect(newposs,10)doTeleportThing(player3.uid,newposs)
doSendMagicEffect(newposs,10)doTeleportThing(player4.uid,newposs)
doSendMagicEffect(newposs,10)end
else
return 0
end
else
doPlayerSendCancel(cid,"Sorry, all players in your team must to be level " .. questlevel .. " drunk and transformed into rats or, all 4 players must be on right positions.")
end
end
return 1
end
Agradeço de novo pela sua atenção!
Editado Janeiro 30 por sisifos
esqueci de citar
info
Grupo: Colaborador
Registrado: 27/12/10
Posts: 271
Reputação: +87
Gênero: Masculino

Boa tarde, testa ai amigo :
function onUse(cid, item, frompos, item2, topos) local outfit = getCreatureOutfit(cid) -- IDS DOS ITENS --- itemidum = 6215 itemiddois = 6216 itemidtres = 6217 itemidquatro = 6218 questlevel = 140 switchUniqueID = 1912 -- unique id da alavanca --- POSS DOS ITENS --- garlicp1 = {x=33143, y=32871, z=9, stackpos=1} garlicp2 = {x=33146, y=32871, z=9, stackpos=1} garlicp3 = {x=33149, y=32871, z=9, stackpos=1} garlicp4 = {x=33152, y=32871, z=9, stackpos=1} --- POSSO PARA ONDE OS PLAYER VAI --- local newposs = {x=33127, y=32490, z=9} --- NÃO MEXER ! -- garlic1 = getThingfromPos(garlicp1) garlic2 = getThingfromPos(garlicp2) garlic3 = getThingfromPos(garlicp3) garlic4 = getThingfromPos(garlicp4) --- POSS DOS PLAYERS player1pos = {x=33145, y=32864, z=9, stackpos=253} player1 = getThingfromPos(player1pos) player2pos = {x=33146, y=32864, z=9, stackpos=253} player2 = getThingfromPos(player2pos) player3pos = {x=33147, y=32864, z=9, stackpos=253} player3 = getThingfromPos(player3pos) player4pos = {x=33148, y=32864, z=9, stackpos=253} player4 = getThingfromPos(player4pos) ---- NÃO MEXA --- knightvoc = getPlayerVocation(player1.uid) sorcvoc = getPlayerVocation(player2.uid) druidvoc = getPlayerVocation(player3.uid) paladinvoc = getPlayerVocation(player4.uid) --- NÃO MEXA --- player1level = getPlayerLevel(player1.uid) player2level = getPlayerLevel(player2.uid) player3level = getPlayerLevel(player3.uid) player4level = getPlayerLevel(player4.uid) if knightvoc == 4 or knightvoc == 8 and paladinvoc == 3 or paladinvoc == 7 and druidvoc == 2 or druidvoc == 6 and sorcvoc == 1 or sorcvoc == 5 then if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then if player1level >= questlevel and player2level >= questlevel and player3level >= questlevel and player4level >= questlevel then if item.uid == switchUniqueID and garlic1.itemid == itemidum and garlic2.itemid == itemiddois and garlic3.itemid == itemidtres and garlic4.itemid == itemidquatro and getCreatureCondition(cid, CONDITION_DRUNK) and outfit.lookType == 21 then doRemoveItem(garlic1.uid,1) doRemoveItem(garlic2.uid,1) doRemoveItem(garlic3.uid,1) doRemoveItem(garlic4.uid,1) doTeleportThing(player1.uid,newposs) doSendMagicEffect(newposs,10) doTeleportThing(player2.uid,newposs) doSendMagicEffect(newposs,10) doTeleportThing(player3.uid,newposs) doSendMagicEffect(newposs,10) doTeleportThing(player4.uid,newposs) doSendMagicEffect(newposs,10) end else return 0 end else doPlayerSendCancel(cid,"Sorry, all players in your team must to be level " .. questlevel .. " drunk and transformed into rats or, all 4 players must be on right positions.") end end return 1 end
Boa tarde, rsrs
Atualizei o código que você me enviou agora pouco, carregou tudo direitinho na distro e não deu erro nenhum.
Fui testar ingame, porém eu clico na alavanca, e não acontece nada, não aparece nenhuma mensagem que eu deveria estar transformado, ou bêbado e também não acusa erro nenhum na distro.
as sources que eu uso são essas: https://github.com/mattyx14/otxserver/
e uma imagem de tentando utilizar a alavanca.
https://uploaddeimagens.com.br/imagens/sshelp-jpg
Continuo agradecendo muito pela sua ajuda!
--------------------------- ATUALIZANDO
Amigo, coloquei a action como:
<action uniqueid="1912" event="script" value="startserpentine.lua"/>
e deu esse erro na distro.
[Error - Action Interface]
data/actions/scripts/startserpentine.lua:onUse
Description:
(internalGetPlayerInfo) Player not found when requesting player info #3
[Error - Action Interface]
data/actions/scripts/startserpentine.lua:onUse
Description:
(internalGetPlayerInfo) Player not found when requesting player info #6
[Error - Action Interface]
data/actions/scripts/startserpentine.lua:onUse
Description:
(internalGetPlayerInfo) Player not found when requesting player info #6
[Error - Action Interface]
data/actions/scripts/startserpentine.lua:onUse
Description:
(internalGetPlayerInfo) Player not found when requesting player info #6
Editado Janeiro 30 por sisifos
mudei uid
info
Grupo: Colaborador
Registrado: 27/12/10
Posts: 271
Reputação: +87
Gênero: Masculino

function onUse(cid, item, frompos, item2, topos) switchUniqueID = 1912 itemum = 2150 itemdoi = 5878 itemtres = 7620 itemquatro = 2505 local outfit = getCreatureOutfit(cid) questlevel = 140 piece1pos = {x=85, y=333, z=7, stackpos=1} getpiece1 = getThingfromPos(piece1pos) piece2pos = {x=86, y=333, z=7, stackpos=1} getpiece2 = getThingfromPos(piece2pos) piece3pos = {x=87, y=333, z=7, stackpos=1} getpiece3 = getThingfromPos(piece3pos) piece4pos = {x=88, y=333, z=7, stackpos=1} getpiece4 = getThingfromPos(piece4pos) player1pos = {x=85, y=332, z=7, stackpos=253} player1 = getThingfromPos(player1pos) player2pos = {x=86, y=332, z=7, stackpos=253} player2 = getThingfromPos(player2pos) player3pos = {x=87, y=332, z=7, stackpos=253} player3 = getThingfromPos(player3pos) player4pos = {x=88, y=332, z=7, stackpos=253} player4 = getThingfromPos(player4pos) knightvoc = getPlayerVocation(player1.uid) paladinvoc = getPlayerVocation(player2.uid) druidvoc = getPlayerVocation(player3.uid) sorcerervoc = getPlayerVocation(player4.uid) nplayer1pos = {x=86, y=3339, z=7} nplayer2pos = {x=87, y=3339, z=7} nplayer3pos = {x=88, y=3339, z=7} nplayer4pos = {x=89, y=3339, z=7} player1level = getPlayerLevel(player1.uid) player2level = getPlayerLevel(player2.uid) player3level = getPlayerLevel(player3.uid) player4level = getPlayerLevel(player4.uid) if knightvoc == 4 or knightvoc == 8 and paladinvoc == 3 or paladinvoc == 7 and druidvoc == 2 or druidvoc == 6 and sorcerervoc == 1 or sorcerervoc == 5 then if player1.itemid == 1 and player2.itemid == 1 and player3.itemid == 1 and player4.itemid == 1 then if player1level >= questlevel and player2level >= questlevel and player3level >= questlevel and player4level >= questlevel then if item.uid == switchUniqueID and getpiece1.itemid == itemum and getpiece2.itemid == itemdoi and getpiece3.itemid == itemtres and getpiece4.itemid == itemquatro and getCreatureCondition(cid, CONDITION_DRUNK) and outfit.lookType == 21 then doSendMagicEffect(player1pos,2) doTeleportThing(player1.uid,nplayer1pos) doTeleportThing(player2.cid,nplayer2pos) doTeleportThing(player3.uid,nplayer3pos) doTeleportThing(player4.uid,nplayer4pos) doSendMagicEffect(nplayer1pos,10) doRemoveItem(getpiece1.uid,1) doSendMagicEffect(player2pos,2) doSendMagicEffect(nplayer2pos,10) doRemoveItem(getpiece2.uid,1) doSendMagicEffect(player3pos,2) doSendMagicEffect(nplayer3pos,10) doRemoveItem(getpiece3.uid,1) doSendMagicEffect(player4pos,2) doSendMagicEffect(nplayer4pos,10) doRemoveItem(getpiece4.uid,1) end else return 0 end end else doPlayerSendCancel(cid,"Sorry, all 4 players must be on right positions.") end return 1 end
Editado Janeiro 30 por Pinpao
vou testar aqui amigo, já te digo!
agradeço novamente
Olá boa noite,
O código rodou, os itens foram aceitos para sacrificio e os players foram teleportados, só tem um problema.
A vocação RP, paladin, não está sendo teleportada, ela fica na sala sozinha e os outros são teleportados normalmente.
Muito obrigado por tudo viu?
info
Grupo: Colaborador
Registrado: 27/12/10
Posts: 271
Reputação: +87
Gênero: Masculino

Vou arrumar e já mando aqui



info
Grupo: Campones
Registrado: 06/11/17
Posts: 24
Reputação: 0
Olá boa noite a todos,
Estou desenvolvendo um Otserv, e preciso de ajuda com um código, procurei muito por ai mas infelizmente não encontrei, e não vejo mais onde conseguir ajuda.
Eu preciso de um Script, que seja necessário:
Level 120, 4 Vocações, 4 Itens para sacrifício, esteja com outfit de um "rato" e com a condição "bêbado"
Exemplo: Gostaria de 4 itens em certas posições, e os players em certos sqms, com os itens de sacrifícios em certos sqms, você precisa estar com um outfit de "rato" e também com a condição "bebado", caso tudo isso esteja alinhado, e você puxa alavanca, será teleportado a uma nova coordenada.
alguém poderia me ajudar com isso? estou disposto a pagar se necessário, agradeço atenção de todos.