TR
dúvida

Alavanca que teleporta, quero por level!

Por Trivelatos, 27 de fev. de 2013 em Scripts

resolvido
script
9
1.7k
TrivelatosT
27 de fevereiro de 2013 às 20:28

Tenho um script de alavanca que teleporta, porém quero que somente level 1000 mais seja teleportado e tenha do custo de 200k.

 

script:

 

 

-- Script Made By: Sonkis (Gabriel Lisboa)

-- Start Config --

local topos = {x=1120, y=1188, z=7} -- Posição para onde o player será teleportado.

-- End Config --

 

function onUse(cid)

if doTeleportThing(cid, topos) then

doPlayerSendTextMessage(cid,20,"You have been teleported to NAME.") -- Mude o NAME para o nome do local que o player será teleportado.

end

end

SkyLighS
27 de fevereiro de 2013 às 20:33
local topos = {x=1120, y=1188, z=7} -- Posição para onde o player será teleportado.
local money = 20000 -- quanto de dinheiro vai remover
local level = 1000 -- quantos levels precisa ter
function onUse(cid)
if doTeleportThing(cid, topos) then
doPlayerRemoveMoney(cid,money)
if getPlayerLevel(cid,level) then
doPlayerSendTextMessage(cid,20,"You have been teleported to NAME.") -- Mude o NAME para o nome do local que o player será teleportado.
end
end

GearsG
27 de fevereiro de 2013 às 20:49

local topos = {x=1120, y=1188, z=7} -- Posição para onde o player será teleportado.
local money = 20000 -- quanto de dinheiro vai remover
local level = 1000 -- quantos levels precisa ter
function onUse(cid)
if doTeleportThing(cid, topos) then
doPlayerRemoveMoney(cid,money)
if getPlayerLevel(cid,level) then
doPlayerSendTextMessage(cid,20,"You have been teleported to NAME.") -- Mude o NAME para o nome do local que o player será teleportado.
end
end

 

Bom, tenho quase certeza de que o colega que fez o post irá somente copiar o seu código e voltará aqui dizendo, pq num funfou? Não irá funcionar porque LUA não aceita acentos, ex; ~,´,etc..

 

Se quiser só copiar e cola o codigo, usa assim.

 

 

local topos = {x=1120, y=1188, z=7} -- Posiçao para onde o player sera teleportado
local money = 20000 -- quanto de dinheiro vai remover
local level = 1000 -- quantos levels precisa ter
function onUse(cid)
if doTeleportThing(cid, topos) then
doPlayerRemoveMoney(cid,money)
if getPlayerLevel(cid,level) then
doPlayerSendTextMessage(cid,20,"You have been teleported to NAME.") -- Mude o NAME para o nome do local que o player será teleportado.
end
end

 

Ps: o xtibia ta quebrando a identação :(

 

@edit

Nem parei para ler o codigo do skyligh, agora que parei para ler, vi que está errado, faltando else, etc..

Usa o do Roksas.

Editado Fevereiro 27 por Gears

RoksasR
27 de fevereiro de 2013 às 20:49

Tente:

 

-- Script Made By: Sonkis (Gabriel Lisboa)

-- Start Config --

local topos = {x=1120, y=1188, z=7} -- Posição para onde o player será teleportado.

-- End Config --

 

function onUse(cid)

if doPlayerRemoveMoney(cid,200000) == TRUE and getPlayerLevel(cid) >= 1000 then

if doTeleportThing(cid, topos) then

doPlayerSendTextMessage(cid,20,"You have been teleported to NAME.") -- Mude o NAME para o nome do local que o player será teleportado.

else

doPlayerSendTextMessage(cid,22,"Apenas leveis 1000+ podem teleportar, pagando 200k!")

end

return true

end

end

 

TrivelatosT
27 de fevereiro de 2013 às 21:03

tira o dinheiro mais não teleporta não... Rokas

RoksasR
27 de fevereiro de 2013 às 21:07

Experimenta:

 

 

-- Script Made By: Sonkis (Gabriel Lisboa)

-- Start Config --

local topos = {x=1120, y=1188, z=7} -- Posição para onde o player será teleportado.

-- End Config --

 

function onUse(cid)

if doPlayerRemoveMoney(cid,200000) == TRUE and getPlayerLevel(cid) >= 1000 then

doTeleportThing(cid, topos)

doPlayerSendTextMessage(cid,20,"You have been teleported to NAME.")

else

doPlayerSendTextMessage(cid,22,"Apenas leveis 1000+ podem teleportar, pagando 200k!")

end

return true

end

 

TrivelatosT
27 de fevereiro de 2013 às 21:09

Opaaa, agora ficou 100%, obrigado de novo Rokas, vlw aos outros 2 que tentou ajuda também, vlwwss!

ErimythE
27 de fevereiro de 2013 às 21:12

Tópico movido para a seção de dúvidas e pedidos resolvidos.

ErimythE
28 de fevereiro de 2013 às 02:05

@SkyMagnum

banido por 7 dias por utilizar palavras ofensivas a outros usuários da comunidade.

 

Tópico desaprovado pela Moderação!