Jump to content

Que hice mal .-.


Recommended Posts

Hola lo que pasa es que tengo este script pero al parecer el debugscript me dice que la linea 40 esta mal como que el evento o algo asi aqui esta el script no ce que hice mal

------------------------------------------------------------------------------------------------------------------------------------------------- 
objeto = createObject ( 16773, -1163.8000488281, -952.59997558594, 132.19999694824, 0, 0, 0 ) 
x,y,z = getElementPosition (objeto) 
Zona = createColSphere ( x, y, z, 15 ) 
function funcion (hitElement) 
if getElementType( hitElement ) == "player" then 
if getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then 
moveObject ( objeto, 800, -1179, -952.59997558594, 132.19999694824 ) 
 end 
 end 
addEventHandler ( "onColShapeHit", Zona, funcion ) 
  
function funcion2 (hitElement) 
 local skin = getPlayerSkin ( hitElement ) 
   if skin == 100 then 
moveObject ( objeto, 800, -1163.8000488281, -952.59997558594, 132.19999694824 ) 
    end 
 end 
 end 
addEventHandler ( "onColShapeLeave", Zona, funcion2 ) 
------------------------------------------------------------------------------------------------------------------------------------------------- 
objeto1 = createObject ( 16773, -1149.1999511719, -952.59997558594, 132.19999694824, 0, 0, 0 ) 
x,y,z = getElementPosition (objeto1) 
Zona1 = createColSphere ( x, y, z, 15 ) 
function funcion3 (hitElement) 
if getElementType( hitElement ) == "player" then 
if getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then 
moveObject ( objeto1, 800, -1136, -952.59997558594, 132.19999694824 ) 
 end 
 end 
addEventHandler ( "onColShapeHit", Zona, funcion3 ) 
  
function funcion4 (hitElement) 
 local skin = getPlayerSkin ( hitElement ) 
   if skin == 100 then 
moveObject ( objeto1, 800, -1149.1999511719, -952.59997558594, 132.19999694824 ) 
    end 
 end 
end 
addEventHandler ( "onColShapeLeave", Zona1, funcion4 ) 
------------------------------------------------------------------------------------------------------------------------------------------------- 

Link to comment

Hola amigo. Quería solicitarte por favor que leas esto: viewtopic.php?f=146&t=54094 y comentes nuevamente con el código en un estado legible. Si bien el formato de algunas partes del codigo está bien legible, te recomiendo normalizar la lectura con el fin de que te podamos ayudar sin mayores inconvenientes.

Un saludo, y no te lo tomes a mal, tomalo como recomendacion para leer más fácil el código así te podemos ayudar.

Con dejar 4 espacios o usar el TABULADOR cuando uses un IF statement, un FOR, una funcion, etc (leé en el TH), ya será suficiente para entender el código, no es necesario el uso de comentarios pero recomendable, aunque no es muy influyente.

Link to comment

Intenta así.

objeto = createObject ( 16773, -1163.8000488281, -952.59997558594, 132.19999694824, 0, 0, 0 ) 
x,y,z = getElementPosition (objeto) 
Zona = createColSphere ( x, y, z, 15 ) 
function funcion (hitElement) 
    if getElementType( hitElement ) == "player" then 
        if getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then 
        moveObject ( objeto, 800, -1179, -952.59997558594, 132.19999694824 ) 
        end 
    end 
end 
addEventHandler ( "onColShapeHit", Zona, funcion ) 
  
function funcion2 (hitElement) 
local skin = getPlayerSkin ( hitElement ) 
    if skin == 100 then 
    moveObject ( objeto, 800, -1163.8000488281, -952.59997558594, 132.19999694824 ) 
    end 
 end 
addEventHandler ( "onColShapeLeave", Zona, funcion2 ) 
------------------------------------------------------------------------------------------------------------------------------------------------- 
objeto1 = createObject ( 16773, -1149.1999511719, -952.59997558594, 132.19999694824, 0, 0, 0 ) 
x,y,z = getElementPosition (objeto1) 
Zona1 = createColSphere ( x, y, z, 15 ) 
function funcion3 (hitElement) 
    if getElementType( hitElement ) == "player" then 
        if getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then 
        moveObject ( objeto1, 800, -1136, -952.59997558594, 132.19999694824 ) 
        end 
    end 
 end 
addEventHandler ( "onColShapeHit", Zona, funcion3 ) 
  
function funcion4 (hitElement) 
local skin = getPlayerSkin ( hitElement ) 
    if skin == 100 then 
    moveObject ( objeto1, 800, -1149.1999511719, -952.59997558594, 132.19999694824 ) 
    end 
 end 
addEventHandler ( "onColShapeLeave", Zona1, funcion4 ) 

Link to comment

Intenta esto ahora

objeto = createObject ( 16773, -1163.8000488281, -952.59997558594, 132.19999694824, 0, 0, 0 ) 
x,y,z = getElementPosition (objeto) 
Zona = createColSphere ( x, y, z, 15 ) 
function funcion (hitElement) 
if getElementType( hitElement ) == "player" then 
if getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then 
moveObject ( objeto, 800, -1179, -952.59997558594, 132.19999694824 ) 
 end 
 end 
 end 
function funcion2 (hitElement) 
 local skin = getPlayerSkin ( hitElement ) 
   if skin == 100 then 
moveObject ( objeto, 800, -1163.8000488281, -952.59997558594, 132.19999694824 ) 
    end 
 end 
addEventHandler ( "onColShapeHit", Zona, funcion ) 
addEventHandler ( "onColShapeLeave", Zona, funcion2 ) 
------------------------------------------------------------------------------------------------------------------------------------------------- 
objeto1 = createObject ( 16773, -1149.1999511719, -952.59997558594, 132.19999694824, 0, 0, 0 ) 
x,y,z = getElementPosition (objeto1) 
Zona1 = createColSphere ( x, y, z, 15 ) 
function funcion3 (hitElement) 
if getElementType( hitElement ) == "player" then 
if getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then 
moveObject ( objeto1, 800, -1136, -952.59997558594, 132.19999694824 ) 
 end 
 end 
 end 
function funcion4 (hitElement) 
 local skin = getPlayerSkin ( hitElement ) 
   if skin == 100 then 
moveObject ( objeto1, 800, -1149.1999511719, -952.59997558594, 132.19999694824 ) 
    end 
 end 
addEventHandler ( "onColShapeHit", Zona, funcion3 ) 
addEventHandler ( "onColShapeLeave", Zona1, funcion4 ) 

pd: lo otro no lo había testeado

Link to comment
  • Recently Browsing   0 members

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