Jump to content

Acensor


eldelahoz

Recommended Posts

Hola lo que pasa es que hice un script para que un objeto subiera como un acensor pero lo que pasa es que llegar a lo ultimo se baja y se sube es como se rebotara aqui esta el script

objeto = createObject ( 3095, -1099.6999511719, -1052.3000488281, 877.90002441406, 0, 0, 0 ) 
x,y,z = getElementPosition (objeto) 
Zona = createColCuboid ( -1102.9949951172, -1055.9497070313, 877.95538330078, 5.75, 6.75, 50 ) 
function funcion (hitElement) 
 if getElementType( hitElement ) == "player" then 
if getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then 
moveObject ( objeto, 8000, -1099.69921875, -1052.3994140625, 931.79998779297 ) 
else 
    outputChatBox ( "No Heres Del Clan Largate", hitElement, 0, 255, 0 ) 
 end 
 end 
end 
addEventHandler ( "onColShapeHit", Zona, funcion ) 
  
function funcion2 (hitElement) 
 if getElementType( hitElement ) == "player" then 
if getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then 
moveObject ( objeto, 8000, -1099.6999511719, -1052.3000488281, 877.90002441406, 0, 0, 0 ) 
    end 
 end 
end 
addEventHandler ( "onColShapeLeave", Zona, funcion2 ) 

Link to comment
  • Administrators

Proba asi

objeto = createObject ( 3095, -1099.6999511719, -1052.3000488281, 877.90002441406, 0, 0, 0 ) 
x,y,z = getElementPosition (objeto) 
Zona = createColCuboid ( -1102.9949951172, -1055.9497070313, 877.95538330078, 5.75, 6.75, 50 ) 
function funcion (hitElement) 
 if getElementType( hitElement ) == "player" and getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then 
moveObject ( objeto, 8000, -1099.69921875, -1052.3994140625, 931.79998779297 ) 
else 
    outputChatBox ( "No Heres Del Clan Largate", hitElement, 0, 255, 0 ) 
 end 
 end 
end 
addEventHandler ( "onColShapeHit", Zona, funcion ) 
  
function funcion2 (hitElement) 
 if getElementType( hitElement ) == "player" and getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then 
moveObject ( objeto, 8000, -1099.6999511719, -1052.3000488281, 877.90002441406, 0, 0, 0 ) 
    end 
 end 
end 
addEventHandler ( "onColShapeLeave", Zona, funcion2 ) 

PD: Heres es ERES con E no H xD

Link to comment
  • Administrators

si es que me he equivocado, proba asi:

objeto = createObject ( 3095, -1099.6999511719, -1052.3000488281, 877.90002441406, 0, 0, 0 ) 
x,y,z = getElementPosition (objeto) 
Zona = createColCuboid ( -1102.9949951172, -1055.9497070313, 877.95538330078, 5.75, 6.75, 50 ) 
function funcion (hitElement) 
 if getElementType( hitElement ) == "player" and getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then 
moveObject ( objeto, 8000, -1099.69921875, -1052.3994140625, 931.79998779297 ) 
else 
    outputChatBox ( "No Heres Del Clan Largate", hitElement, 0, 255, 0 ) 
 end 
 end 
addEventHandler ( "onColShapeHit", Zona, funcion ) 
  
function funcion2 (hitElement) 
 if getElementType( hitElement ) == "player" and getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then 
moveObject ( objeto, 8000, -1099.6999511719, -1052.3000488281, 877.90002441406, 0, 0, 0 ) 
    end 
 end 
addEventHandler ( "onColShapeLeave", Zona, funcion2 ) 

Link to comment
objeto = createObject ( 3095, -1099.6999511719, -1052.3000488281, 877.90002441406, 0, 0, 0 ) 
x,y,z = getElementPosition (objeto) 
Zona = createColRectangle ( -1102.9949951172, -1055.9497070313, 877.95538330078, 5,5 ) 
function funcion (hitElement) 
    if getElementType( hitElement ) == "player" then 
        if getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then 
            moveObject ( objeto, 8000, -1099.69921875, -1052.3994140625, 931.79998779297 ) 
        else 
            outputChatBox ( "No Heres Del Clan Largate", hitElement, 0, 255, 0 ) 
        end 
    end 
end 
addEventHandler ( "onColShapeHit", Zona, funcion ) 
  
function funcion2 (hitElement) 
    if getElementType( hitElement ) == "player" then 
        if getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then 
            moveObject ( objeto, 8000, -1099.6999511719, -1052.3000488281, 877.90002441406 ) 
        end 
    end 
end 

Link to comment

No mejor no ya pense otra cosa seria asi pero tengo un problema y es que no les aparece el mensaje ._.

open = false 
theObject = createObject ( 3115, -946.79998779297, -941.09997558594, 928.59997558594, 0, 0, 0 ) 
addCommandHandler( "bajar_a", 
  function ( ) 
   if not open then 
     moveObject( theObject, 5000, -946.79998779297, -941.09997558594, 725.59997558594) 
     else 
    outputChatBox ( "El Comando para bajar y subir es: bajar_a", hitElement, 0, 255, 0 ) 
     open = true 
  elseif open then 
     moveObject( theObject, 2000, -946.79998779297, -941.09997558594, 928.59997558594 ) 
     open = false 
   end 
 end 
) 

Link to comment
open = false 
theObject = createObject ( 3115, -946.79998779297, -941.09997558594, 928.59997558594, 0, 0, 0 ) 
addCommandHandler( "bajar_a", 
  function ( ) 
   if not open then 
     moveObject( theObject, 5000, -946.79998779297, -941.09997558594, 725.59997558594) 
    outputChatBox ( "El Comando para bajar y subir es: bajar_a", hitElement, 0, 255, 0 ) 
     open = true 
  elseif open then 
     moveObject( theObject, 2000, -946.79998779297, -941.09997558594, 928.59997558594 ) 
     open = false 
   end 
 end 
) 

Link to comment

Gracias pero quiero saber como puedo hacer para hacer otra alternativa de este script ya que es muy largo:

open = false 
theObject = createObject ( 3115, -946.79998779297, -941.09997558594, 928.59997558594, 0, 0, 0 ) 
addCommandHandler( "avion_1", 
  function ( ) 
   if not open then 
     moveObject( theObject, 8000, -946.79998779297, -941.09997558594, 725.59997558594) 
     outputChatBox ( "El Comando para bajar y subir es: avion_1", hitElement, 0, 255, 0 ) 
     open = true 
  elseif open then 
     moveObject( theObject, 5000, -946.79998779297, -941.09997558594, 928.59997558594 ) 
     open = false 
   end 
 end 
) 
  
open = false 
theObject2 = createObject ( 3115, -914.5, -941, 928.59997558594, 0, 0, 0 ) 
addCommandHandler( "avion_2", 
  function ( ) 
   if not open then 
     moveObject( theObject2, 8000, -946.79998779297, -941.09997558594, 725.59997558594) 
     outputChatBox ( "El Comando para bajar y subir es: avion_2", hitElement, 0, 255, 0 ) 
     open = true 
  elseif open then 
     moveObject( theObject2, 5000, -914.5, -941, 928.59997558594 ) 
     open = false 
   end 
 end 
) 
  
open = false 
theObject3 = createObject ( 3115, -882, -940.8994140625, 928.59997558594, 0, 0, 0 ) 
addCommandHandler( "avion_3", 
  function ( ) 
   if not open then 
     moveObject( theObject3, 8000, -882, -940.8994140625, 725.59997558594) 
     outputChatBox ( "El Comando para bajar y subir es: avion_3", hitElement, 0, 255, 0 ) 
     open = true 
  elseif open then 
     moveObject( theObject3, 5000, -882, -940.8994140625, 928.59997558594 ) 
     open = false 
   end 
 end 
) 
  
open = false 
theObject4 = createObject ( 3115, -947.29998779297, -965.90002441406, 927.90002441406, 0, 0, 0 ) 
addCommandHandler( "avion_4", 
  function ( ) 
   if not open then 
     moveObject( theObject4, 8000, -947.29998779297, -965.90002441406, 725.59997558594) 
     outputChatBox ( "El Comando para bajar y subir es: avion_4", hitElement, 0, 255, 0 ) 
     open = true 
  elseif open then 
     moveObject( theObject4, 5000, -947.29998779297, -965.90002441406, 927.900024414064 ) 
     open = false 
   end 
 end 
) 
  
open = false 
theObject5 = createObject ( 3115, -914.20001220703, -965.59997558594, 927.90002441406, 0, 0, 0 ) 
addCommandHandler( "avion_5", 
  function ( ) 
   if not open then 
     moveObject( theObject5, 8000, -914.20001220703, -965.59997558594, 725.59997558594) 
     outputChatBox ( "El Comando para bajar y subir es: avion_5", hitElement, 0, 255, 0 ) 
     open = true 
  elseif open then 
     moveObject( theObject5, 5000, -914.20001220703, -965.59997558594, 927.90002441406 ) 
     open = false 
   end 
 end 
) 
  
open = false 
theObject6 = createObject ( 3115, -881.40002441406, -965.90002441406, 927.90002441406, 0, 0, 0 ) 
addCommandHandler( "avion_6", 
  function ( ) 
   if not open then 
     moveObject( theObject6, 8000, -881.40002441406, -965.90002441406, 725.59997558594) 
     outputChatBox ( "El Comando para bajar y subir es: avion_6", hitElement, 0, 255, 0 ) 
     open = true 
  elseif open then 
     moveObject( theObject6, 5000, -881.40002441406, -965.90002441406, 927.90002441406 ) 
     open = false 
   end 
 end 
) 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...