tem uns bugs ai o 1º é q vc n pode usar elseif se n tiver um if antes entao, essa linha
elseif (config.batlle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
vira
if (config.batlle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
outra coisa, aki
elseif(config.townp == "yes") then doTeleportThing(cid, townpos) doCreatureSay(cid, msgt, TALKTYPE_ORANGE_1) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED) return 1
vc usou o return entao o script vai retornar o 1 e vai parar de ser lido. normalmente n há problema, mas no seu caso há, porq vai teleportar o player e n vai checar se ele ta em pz ou remover o item dele (claro, finge q eu puis "yes" nos dois casos)
agr só pra encher o saco, é battle e n batlle ;d
outro bug
doSendMagicEffect(nplayer1pos,10)
vc n declarou essa variavel nplayer1pos, ou seja, o script n vai entender
e aki
doSendMagicEffect(topos,6)
topos é o lugar onde vc da use with, tipo, vc clica com a cara de pescar em na pos X entao topos vai ser X, se o item q vc usar nesse script n aparecer use with topos vai ser nula
ediçoes minimas no seu script ficou assim (obs n testei)
function onUse(cid, item, frompos, item2, topos)
config = {
rmvitem ="yes",
battle ="yes",
townp ="yes",
pos = {x=x, y=y, z=z},
pz ="no"
}
local p = getPlayerTown(cid)
local townpos = getTownTemplePosition(p)
local msgt ="~ "..getPlayerName(cid).." Foi Teleportado. ~"
if (config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendCancel(cid, "Você precisa estar sem o batlle.")
return 1
elseif (config.pz =="yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendCancel(cid, "Você precisa estar em Protection Zone.")
return 1
elseif(config.rmvitem =="yes") then
doRemoveItem(item.uid, 1)
end
if(config.townp == "yes") then
doTeleportThing(cid, townpos)
doCreatureSay(cid, msgt, TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
return 1
end
doTeleportThing(cid,pos)
doSendMagicEffect(frompos,6)
return 1
end







info
Grupo: Campones
Registrado: 06/01/11
Posts: 98
Reputação: +2
Bem, so scripter faz um tempo...
Mas não me considero SCRIPTER, e sim SCRIPTE (sem r, por quê só sei editar script), bem, até que ja fiz umas scripts, mas bem feinhas, sabe, aquelas inuteis ?
Então, eu tentei fazer a minha primeira script 100% feita por mim.
E aqui la vamos nós, achei uma melda.
A melda é: A script não funciona.
function onUse(cid, item, frompos, item2, topos)
config = {
rmvitem ="yes",
batlle ="yes",
townp ="yes",
pos = {x=x, y=y, z=z},
pz ="no"
}
local p = getPlayerTown(cid)
local townpos = getTownTemplePosition(p)
local msgt ="~ "..getPlayerName(cid).." Foi Teleportado. ~"
local fail ="'O Teleport Falhou.'"
elseif (config.batlle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendCancel(cid, "Você precisa estar sem o batlle.")
return 1
elseif(config.townp == "yes") then
doTeleportThing(cid, townpos)
doCreatureSay(cid, msgt, TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
return 1
elseif (config.pz =="yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendCancel(cid, "Você precisa estar em Protection Zone.")
return 1
end
if(config.rmvitem =="yes") then
doRemoveItem(item.uid, 1)
end
doTeleportThing(cid,pos)
doSendMagicEffect(nplayer1pos,10)
doSendMagicEffect(topos,6)
doSendMagicEffect(frompos,6)
end
return 1
end
Quem me ajudar, ganha um grande e lindo obrigado e um abraço.
Atenciosamente, leleeuh.
@EDIT:
É para styller 8.60
Editado Janeiro 6 por leleeuh