Postado Janeiro 16, 2016 9 anos Eu fiz esse script mais ele não funciona como eu queria. Queria que aparecesse o item 13017 no determinado local e fosse removido depois de 1 minuto. Segue script . Mostrar conteúdo oculto function onUse(cid, item, frompos, item2, topos) wall1 = {x=88, y=188, z=7, stackpos=1} wall2 = {x=88, y=189, z=7, stackpos=1} getwall1 = getThingfromPos(wall1) getwall2 = getThingfromPos(wall2) local tempo = 1*60 -- tempo para parede voltar if item.uid == 60010 and item.itemid == 9826 then doCreateItem(13017,1,wall1) doCreateItem(13017,1,wall2) doPlayerSendTextMessage(cid,22,"Uma nova passagem foi aberta!") doTransformItem(item.uid,item.itemid-1) elseif item.uid == 60010 and item.itemid == 9825 then doRemoveItem(getwall1.uid,1) doRemoveItem(getwall2.uid,1) addEvent(doRemoveItem, tempo, 13017, getwall1.uid,1) doTransformItem(item.uid,item.itemid+1) else doPlayerSendTextMessage(cid,22,"Não é possivel realizar esta ação.") end return 1 end
Postado Janeiro 16, 2016 9 anos Tenta assim e vê se dá: function onUse(cid, item, frompos, item2, topos) local wall1 = {x=88, y=188, z=7, stackpos=1} local wall2 = {x=88, y=189, z=7, stackpos=1} local getwall1 = getThingfromPos(wall1) local getwall2 = getThingfromPos(wall2) local tempo = 1*60 -- tempo para parede voltar if item.uid == 60010 and item.itemid == 9826 then doCreateItem(13017,1,wall1) doCreateItem(13017,1,wall2) doPlayerSendTextMessage(cid,22,"Uma nova passagem foi aberta!") doTransformItem(item.uid,item.itemid-1) elseif item.uid == 60010 and item.itemid == 9825 then doRemoveItem(getwall1.uid,1) doRemoveItem(getwall2.uid,1) addEvent(doRemoveItem, tempo, 13017, getwall1.uid,1) doTransformItem(item.uid,item.itemid+1) else doPlayerSendTextMessage(cid,22,"Não é possivel realizar esta ação.") end return 1 end Se não, explica qual o erro, se não funciona nada ou só uma parte. Edited: Porque pelo que está no 'script' se vc usa o item 9826 os 'walls' somente surge e não irão desaparecer com tempo, mas serão transformados. Jà no segundo ponto vc pediu pra função com o item 9825 usar o tempo. Conta como quer que ajeito aqui. Editado Janeiro 16, 2016 9 anos por Xagah (veja o histórico de edições) The Last Man Standing - 100% funcional
Postado Janeiro 16, 2016 9 anos Autor Em 16/01/2016 em 20:09, Xagah disse: Tenta assim e vê se dá: function onUse(cid, item, frompos, item2, topos) local wall1 = {x=88, y=188, z=7, stackpos=1} local wall2 = {x=88, y=189, z=7, stackpos=1} local getwall1 = getThingfromPos(wall1) local getwall2 = getThingfromPos(wall2) local tempo = 1*60 -- tempo para parede voltar if item.uid == 60010 and item.itemid == 9826 then doCreateItem(13017,1,wall1) doCreateItem(13017,1,wall2) doPlayerSendTextMessage(cid,22,"Uma nova passagem foi aberta!") doTransformItem(item.uid,item.itemid-1) elseif item.uid == 60010 and item.itemid == 9825 then doRemoveItem(getwall1.uid,1) doRemoveItem(getwall2.uid,1) addEvent(doRemoveItem, tempo, 13017, getwall1.uid,1) doTransformItem(item.uid,item.itemid+1) else doPlayerSendTextMessage(cid,22,"Não é possivel realizar esta ação.") end return 1 end Se não, explica qual o erro, se não funciona nada ou só uma parte. Man ele esta aparecendo o erro (doRemoveItem) Item not found. Ele cria mais não remove depois de 1 minuto.
Postado Janeiro 16, 2016 9 anos Tenta assim: function onUse(cid, item, frompos, item2, topos) config = { wall1 = {x=88, y=188, z=7, stackpos=1} wall2 = {x=88, y=189, z=7, stackpos=1} getwall1 = getThingfromPos(wall1) getwall2 = getThingfromPos(wall2) tempo = 1 -- temop em minutos aqui } function remove() local itemA = getThingFromPos(config.wall1) local itemB = getThingFromPos(config.wall2) doRemoveItem(itemA.uid, 1) doRemoveItem(itemB.uid, 1) return true end if item.uid == 60010 and item.itemid == 9826 then doCreateItem(13017,1,config.wall1) doCreateItem(13017,1,config.wall2) doPlayerSendTextMessage(cid,22,"Uma nova passagem foi aberta!") addEvent(remove, config.tempo*60*1000) else doPlayerSendTextMessage(cid,22,"Não é possivel realizar esta ação.") end end Aproveitando, o que são os itens de 'id' 9825 e 9826? Porque neste de cima só deixei o 9826. Se disser o que são posso deixar 'script' mais completo. Ajudei? Rep+. The Last Man Standing - 100% funcional
Postado Janeiro 16, 2016 9 anos Autor É a alavanca de yahala para um lado ela é 9825 e para o outro ela é 9826. Eu queria que quando puxasse a alavanca criasse a parede e depois de 1 minuto ela desaparecesse e só podia puxa a alavanca novamente depois de 2 minutos. Voou testar esse script aii Em 16/01/2016 em 20:19, Xagah disse: Tenta assim: function onUse(cid, item, frompos, item2, topos) config = { wall1 = {x=88, y=188, z=7, stackpos=1} wall2 = {x=88, y=189, z=7, stackpos=1} getwall1 = getThingfromPos(wall1) getwall2 = getThingfromPos(wall2) tempo = 1 -- temop em minutos aqui } function remove() local itemA = getThingFromPos(config.wall1) local itemB = getThingFromPos(config.wall2) doRemoveItem(itemA.uid, 1) doRemoveItem(itemB.uid, 1) return true end if item.uid == 60010 and item.itemid == 9826 then doCreateItem(13017,1,config.wall1) doCreateItem(13017,1,config.wall2) doPlayerSendTextMessage(cid,22,"Uma nova passagem foi aberta!") addEvent(remove, config.tempo*60*1000) else doPlayerSendTextMessage(cid,22,"Não é possivel realizar esta ação.") end end Aproveitando, o que são os itens de 'id' 9825 e 9826? Porque neste de cima só deixei o 9826. Se disser o que são posso deixar 'script' mais completo. Ajudei? Rep+. @Xagah man kkkkkkk deuu bug maiis deu um bug tão engraçado que , quando eu clikei na alavanca eu ganhei um item donate kkkkkkkk
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.