LANS Posted July 27, 2012 Share Posted July 27, 2012 hola, estoy haciendo un server de zombies y tengo con las puertas que se abren ante la presencia de un jugador pero mi problema es que tambien se abren ante los zombies este es el script checkGateMarker = createMarker ( 2463.6999511719, 1963.3000488281, 10.800000190735, "corona", 9.0, 0, 0, 255, 0 ) function createGate () gatePolice1 = createObject ( 971, 2463.7998046875, 1963.19921875, 13.5, 0, 0, 179.99450683594) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) function gateCheckingTeam ( thePlayer, matchingDimension ) moveObject ( gatePolice1, 1000, 2455, 1963.1999511719, 13.5 ) end addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) function movingBackPolice ( thePlayer, matchingDimension ) moveObject ( gatePolice1, 1000, 2463.7998046875, 1963.19921875, 13.5 ) end addEventHandler ( "onMarkerLeave", checkGateMarker, movingBackPolice ) ¿que debo agregar para solucionar este problema? Link to comment
Alexs Posted July 27, 2012 Share Posted July 27, 2012 getElementType y revisar si el tipo es "player" y tambien ponerlo en client evitara trolleos Link to comment
LANS Posted July 27, 2012 Author Share Posted July 27, 2012 ok, gracias por la respuesta lo intentare Link to comment
LANS Posted July 27, 2012 Author Share Posted July 27, 2012 no me ha funcionado lo que hice pero no se si esta bien checkGateMarker = createMarker ( 2463.6999511719, 1963.3000488281, 10.800000190735, "corona", 9.0, 0, 0, 255, 0 ) function createGate () gatePolice1 = createObject ( 971, 2463.7998046875, 1963.19921875, 13.5, 0, 0, 179.99450683594) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) function gateCheckingTeam ( thePlayer, matchingDimension ) if getElementType (hitPlayer) =="player" then moveObject ( gatePolice1, 1000, 2455, 1963.1999511719, 13.5 ) end end addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) function movingBackPolice ( thePlayer, matchingDimension ) moveObject ( gatePolice1, 1000, 2463.7998046875, 1963.19921875, 13.5 ) end addEventHandler ( "onMarkerLeave", checkGateMarker, movingBackPolice ) Link to comment
Vision Posted July 27, 2012 Share Posted July 27, 2012 checkGateMarker = createMarker ( 2463.6999511719, 1963.3000488281, 10.800000190735, "corona", 9.0, 0, 0, 255, 0 ) function createGate () gatePolice1 = createObject ( 971, 2463.7998046875, 1963.19921875, 13.5, 0, 0, 179.99450683594) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) function gateCheckingTeam ( hitPlayer, matchingDimension ) if getElementType (hitPlayer) =="player" then moveObject ( gatePolice1, 1000, 2455, 1963.1999511719, 13.5 ) end end addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) function movingBackPolice ( thePlayer, matchingDimension ) moveObject ( gatePolice1, 1000, 2463.7998046875, 1963.19921875, 13.5 ) end addEventHandler ( "onMarkerLeave", checkGateMarker, movingBackPolice ) Link to comment
LANS Posted July 28, 2012 Author Share Posted July 28, 2012 no me funciona me lanza el siguiente error: lua:19 bad argument @ ' addeventhandler [expected element at argument 2, got nil] Link to comment
Plate Posted July 28, 2012 Share Posted July 28, 2012 Proba haci checkGateMarker = createMarker ( 2463.6999511719, 1963.3000488281, 10.800000190735, "corona", 9.0, 0, 0, 255, 0 ) function createGate () gatePolice1 = createObject ( 971, 2463.7998046875, 1963.19921875, 13.5, 0, 0, 179.99450683594) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) function gateCheckingTeam ( hitPlayer, matchingDimension ) if getElementType (hitPlayer) =="player" then moveObject ( gatePolice1, 1000, 2455, 1963.1999511719, 13.5 ) end end addEventHandler ( "onMarkerHit", getRootElement(), gateCheckingTeam ) function movingBackPolice ( thePlayer, matchingDimension ) moveObject ( gatePolice1, 1000, 2463.7998046875, 1963.19921875, 13.5 ) end addEventHandler ( "onMarkerLeave", getRootElement(), movingBackPolice ) PD: checkGateMarker NO EXISTE Link to comment
Recommended Posts