Jokeℝ1472771893 Posted May 25, 2012 Share Posted May 25, 2012 local marker1 = createMarker ( 1253.0999755859, -1399, 12, 'cylinder', 11, 222, 222, 1, 225 ) local gate1 = createObject ( 980, 1252.8000488281, -1399.0999755859, 14.800000190735, 0, 0, 90 ) function movingObject ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" then moveObject ( gate1, 3000, 1252.8000488281, -1413, 14.800000190735 ) end end function moveObjectBack () if getElementType ( hitElement ) == "player" then moveObject ( gate1, 3000, 1252.8000488281, -1399.0999755859, 14.800000190735 ) end end addEventHandler ( "onMarkerHit", marker1 , movingObject ) addEventHandler ( "onMarkerLeave", marker1, moveObjectBack ) what is wrong? Link to comment
Alpha Posted May 25, 2012 Share Posted May 25, 2012 You didn't add hitElement as an argument for moveObjectBack function. local marker1 = createMarker ( 1253.0999755859, -1399, 12, 'cylinder', 11, 222, 222, 1, 225 ) local gate1 = createObject ( 980, 1252.8000488281, -1399.0999755859, 14.800000190735, 0, 0, 90 ) function movingObject ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" then moveObject ( gate1, 3000, 1252.8000488281, -1413, 14.800000190735 ) end end function moveObjectBack (hitElement) if getElementType ( hitElement ) == "player" then moveObject ( gate1, 3000, 1252.8000488281, -1399.0999755859, 14.800000190735 ) end end addEventHandler ( "onMarkerHit", marker1 , movingObject ) addEventHandler ( "onMarkerLeave", marker1, moveObjectBack ) Link to comment
Jokeℝ1472771893 Posted May 25, 2012 Author Share Posted May 25, 2012 You didn't add hitElement as an argument for moveObjectBack function. local marker1 = createMarker ( 1253.0999755859, -1399, 12, 'cylinder', 11, 222, 222, 1, 225 ) local gate1 = createObject ( 980, 1252.8000488281, -1399.0999755859, 14.800000190735, 0, 0, 90 ) function movingObject ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" then moveObject ( gate1, 3000, 1252.8000488281, -1413, 14.800000190735 ) end end function moveObjectBack (hitElement) if getElementType ( hitElement ) == "player" then moveObject ( gate1, 3000, 1252.8000488281, -1399.0999755859, 14.800000190735 ) end end addEventHandler ( "onMarkerHit", marker1 , movingObject ) addEventHandler ( "onMarkerLeave", marker1, moveObjectBack ) thnx Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now