Jade Posted March 18, 2014 Posted March 18, 2014 local basekapi1 = createObject ( 980, 135.89999389648, 1941.6999511719, 21.10000038147, 0, 0, 0 ) local basekapi2 = createObject ( 980, 134.5, 1941.6999511719, 21.10000038147, 0, 0, 0 ) local marker1 = createMarker( 135.10000610352, 1941.3000488281, 18.39999961853, "cylinder", 10, 255, 255, 255, 0) function kapiac(pla) if getElementType ( pla ) == "player" then moveObject(basekapi1, 2000, 135.89999389648, 1941.6999511719, 26.60000038147, 0, 0, 0) moveObject(basekapi2, 2000, 134.5, 1941.6999511719, 26.60000038147, 0, 0, 0) end end addEventHandler( "onMarkerHit", marker1, kapiac ) Console: WARNING: S.lua:6: Bad argument @ 'getElementType' [Expected element at argument 1] trying the door, but I got this error?
JR10 Posted March 18, 2014 Posted March 18, 2014 I'm not entirely sure what causes the error, but you can use isElement. Try this: local basekapi1 = createObject ( 980, 135.89999389648, 1941.6999511719, 21.10000038147, 0, 0, 0 ) local basekapi2 = createObject ( 980, 134.5, 1941.6999511719, 21.10000038147, 0, 0, 0 ) local marker1 = createMarker( 135.10000610352, 1941.3000488281, 18.39999961853, "cylinder", 10, 255, 255, 255, 0) function kapiac(pla) if isElement(pla) and getElementType ( pla ) == "player" then moveObject(basekapi1, 2000, 135.89999389648, 1941.6999511719, 26.60000038147, 0, 0, 0) moveObject(basekapi2, 2000, 134.5, 1941.6999511719, 26.60000038147, 0, 0, 0) end end addEventHandler( "onMarkerHit", marker1, kapiac )
Noki Posted March 19, 2014 Posted March 19, 2014 pla is undefined, and not a parameter of onMarkerHit.
JR10 Posted March 19, 2014 Posted March 19, 2014 What are you talking about? pla is the first argument which is the hitElement.
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