Postado Maio 3, 2017 8 anos Galera acabei de criar 1 script aqui e estou querendo saber se está faltando algo !! é porque sou novo nisso... o script é 1 seguinte: 1 item que faz com que você teleporte para outro lugar ! porem tem que possuir lvl 1000 e pagar 50hd (2160) Spoiler function onUse(cid, item, fromPosition, itemEx, toPosition) local level = 1000 local price = 50 toPos = {x=359, y=1667, z=7}, if getPlayerLevel(cid) >= level and price >= 50 then doRemoveItem(2160, 50) doTeleportThing(cid, toPos) doPlayerSendTextMessage(cid, "Você foi teleportado !") else doPlayerSendTextMessage(cid, "Você não possui level " .. level .. " e não tem " .. price .. " HD!!!") end end return true Por favor se estiver errado me avise, pois estou aqui para aprender e não para querer ser melhor que ninguém !! :D Meus trabalhos: [Movements] TFS 1.1+ Area Hardcore [Movements] TFS 1.1+ Tile Party [Action] TFS 1.1+ Bau diário [Action] TFS 1.1+ Guild Dungeon Lever [Talkactions] TFS 0.3.6 / 0.4 Quest Hunt por Tempo Contato: Discord: Tataboy67#4934
Postado Maio 4, 2017 8 anos Mude toPos = {x=359, y=1667, z=7}, Para toPos = {x=359, y=1667, z=7} Mude end return true Para return true end Mude doPlayerSendTextMessage(cid, "Você foi teleportado !") else doPlayerSendTextMessage(cid, "Você não possui level " .. level .. " e não tem " .. price .. " HD!!!") Para doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você foi teleportado !") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui level " .. level .. " e não tem " .. price .. " HD!!!") A syntax estará correta após essas alterações, vendo as funções teve só erro no return e doPlayerSendTextMessage. Teste e me avise aqui no tópico. https://github.com/Cjaker/ , _ , ( o o ) /'` ' `'\ ESTOU TE OBSERVANDO O_O |'''''''| |\\'''//| """
Postado Maio 4, 2017 8 anos @ES Ichigo Percebi que você deixou passar isso: if getPlayerLevel(cid) >= level and price >= 50 then doRemoveItem(2160, 50) rsrs if getPlayerLevel(cid) >= level and getPlayerItemCount(cid, 2160) >= price then doPlayerRemoveItem(cid, 2160, 50) Reformulando todo script, eu faria assim: function onUse(cid, item, fromPosition, itemEx, toPosition) local level = 1000 local price = 50 toPos = { x = 359 , y = 1667 , z = 7 } if getPlayerLevel(cid) >= level and getPlayerItemCount(cid, 2160) >= price then doPlayerRemoveItem(cid, 2160, price) doTeleportThing(cid, toPos) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você foi teleportado!") else if getPlayerLevel(cid) < level and getPlayerItemCount(cid, 2160) < price then str = "Você não possui level ".. level .." e não tem ".. price .." HD!!!" elseif getPlayerLevel(cid) < level and getPlayerItemCount(cid, 2160) >= price then str = "Você não possui level ".. level .."!" elseif getPlayerItemCount(cid, 2160) < price and getPlayerLevel(cid) >= level then str = "Você não possui ".. price .." HD!" end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) end return true end Tem uma forma melhor, eu sei disso, porém eu me perco se botar muito if em cima de if kkk Editado Maio 4, 2017 8 anos por luangop erro meu (veja o histórico de edições) Te ajudei? Clique em Gostei ! ²²²d¬¬b²²² "She's got a smile that it seems to me...." ♪♪
Postado Maio 4, 2017 8 anos @luangopSim hauhuahuah agora que fui ver xD https://github.com/Cjaker/ , _ , ( o o ) /'` ' `'\ ESTOU TE OBSERVANDO O_O |'''''''| |\\'''//| """
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.