Julian09123 Posted April 7, 2013 Share Posted April 7, 2013 Hola, amigos Quisiera saber como podria hacer para que cuando escriba el jugador un comando por ejemplo /zona Te teletransporte a un lugar.? Link to comment
Sasu Posted April 7, 2013 Share Posted April 7, 2013 function teleport(source) setElementPosition(source, x, y, z) end addCommandHandler("zona", teleport) Link to comment
Julian09123 Posted April 7, 2013 Author Share Posted April 7, 2013 Muchas gracias Sasuke Eres el mejor Y para agregarle Un Mensage cada 5 minutos seria haci? function teleport(source) setElementPosition(source, x, y, z) outputChatBox ( "Aqui el texto", getRootElement(), 255, 0, 0, true ) setTimer ( function() end, 5000, 1 ) end addCommandHandler("zona", teleport) Link to comment
NodZen Posted April 7, 2013 Share Posted April 7, 2013 function Chat () outputChatBox ( "Aqui el texto", getRootElement(), 255, 0, 0, true) -- Solo va true si usas colores HTML. end setTimer(Chat, 500000,0) Link to comment
Julian09123 Posted April 7, 2013 Author Share Posted April 7, 2013 Nod Haci no me anda function teleport(source) setElementPosition(source, -2522.9711914063, -637.05572509766, 147.90631103516) function Chat () outputChatBox ( "Aqui el texto", getRootElement(), 255, 0, 0, true) -- Solo va true si usas colores HTML. end setTimer(Chat, 50000,1) end addCommandHandler("zonaafk", teleport) Link to comment
NodZen Posted April 7, 2013 Share Posted April 7, 2013 (edited) No te va a andar, porque Yo solo te dí la funcion para que aparesca el mensaje en el chat. Edited April 7, 2013 by Guest Link to comment
Renkon Posted April 7, 2013 Share Posted April 7, 2013 function teleport(source) setElementPosition(source, -2522.9711914063, -637.05572509766, 147.90631103516) setTimer(function() outputChatBox("Ola k ase", root, 255, 0, 0, true) end, 300000,1) end addCommandHandler("zonaafk", teleport) Link to comment
AlvareZ_ Posted April 7, 2013 Share Posted April 7, 2013 Ham intenta esto: function teleport(source) setElementPosition(source, -2522.9711914063, -637.05572509766, 147.90631103516) setTimer (outputChatBox, 3000, 1, source, "Aqui el texto", 255, 0, 0, true) end addCommandHandler("zonaafk", teleport) Link to comment
Julian09123 Posted April 7, 2013 Author Share Posted April 7, 2013 renk el tuyo me funciono pero cada vez q ponia /zonaafk hay me decia el texto y no lo quiero haci quiero q todos lo lean sin escribir un comando ah alvarez y el tuyo me dice bad argument ouputChatBox Link to comment
AlvareZ_ Posted April 7, 2013 Share Posted April 7, 2013 (edited) Hmm creo que seria algo asi: local lazona = createColCuboid ( X, Y, Z, 10.0, 10.0, 10.0 ) -- Aqui tu colShape function teleport(source) setElementPosition(source, -2522.9711914063, -637.05572509766, 147.90631103516) setTimer(outputChatBox, 3000, 1, getRootElement(), "Aqui el texto", 255, 0, 0, true) end else if ( isElementWithinColShape ( source, lazona ) ) then removeCommandHandler ( "zonaafk" ) outputChatBox ( "Ya estas en la Zona AFK", getRootElement(), 255, 0, 0, true ) end end addCommandHandler("zonaafk", teleport) Edited April 7, 2013 by Guest Link to comment
NodZen Posted April 7, 2013 Share Posted April 7, 2013 Hmm creo que seria algo asi: local lazona = createColCuboid ( X, Y, Z, 10.0, 10.0, 10.0 ) -- Aqui tu colShape function teleport(source) setElementPosition(source, -2522.9711914063, -637.05572509766, 147.90631103516) setTimer(outputChatBox, 3000, 1, getRootElement(), "Aqui el texto", 255, 0, 0, true) end else if ( isElementWithinColShape ( source, lazona ) ) then removeCommandHandler ( "zonaafk" ) outputChatBox ( "Ya estas en la Zona AFK", getRootElement(), 255, 0, 0, true ) end addCommandHandler("zonaafk", teleport) Te falta un 'end'. Link to comment
AlvareZ_ Posted April 7, 2013 Share Posted April 7, 2013 Ham listo no?, gracias por avisarme Link to comment
Sasu Posted April 7, 2013 Share Posted April 7, 2013 Mal. Alvarez usas un else y ni siquiera abriste un if. Prueba asi: local lazona = createColCuboid ( X, Y, Z, 10.0, 10.0, 10.0 ) -- Aqui tu colShape function teleport(source) if ( not isElementWithinColShape ( source, lazona ) ) then setElementPosition(source, -2522.9711914063, -637.05572509766, 147.90631103516) setTimer(outputChatBox, 3000, 1, "Aqui el texto", root, 255, 0, 0, true) outputChatBox ( "Ya estas en la Zona AFK", getRootElement(), 255, 0, 0, true ) end end addCommandHandler("zonaafk", teleport) Link to comment
Recommended Posts