Twiz. Posted November 7, 2012 Posted November 7, 2012 Hey Guys need help , i want to create a Marker with the Coordinates from the Table. I already did a thread like this but i was too dumb to understand . I hope you understand what i want , i want to create a little job to run into marker then go to another marker etc. . I can script everything else i want to but this is not working for me . local markerst = { <---- Table with Coordinates [1] = { 1, 1, 1}, [2] = { 2, 2, 2}, [3] = { 3, 3, 3}, } function idontgethowtodothis ( ) local x, y, z = i want the coordinates from up there ^ testarker = createMarker( x, y, z , . . . . ) addEventHandler("onMarkerHit", testarker, destroy) end function destroy() destroyElement( testarker ) end -- This is just an Example please help me : (
Fresku Posted November 7, 2012 Posted November 7, 2012 local x, y, z = markerst[1][1], markerst[1][2], markerst[1][3] Make a loop to get each of them coordinates
Castillo Posted November 7, 2012 Posted November 7, 2012 Would be easier to use unpack. local x, y, z = unpack ( markerst [ 1 ] )
Fresku Posted November 7, 2012 Posted November 7, 2012 Would be easier to use unpack. local x, y, z = unpack ( markerst [ 1 ] ) Very nice... Very nice
Twiz. Posted November 7, 2012 Author Posted November 7, 2012 I dont know if i´m doing something wrong but both wont work for me i dont see a Marker .
Castillo Posted November 7, 2012 Posted November 7, 2012 local markerst = -- Table with Coordinates { [ 1 ] = { 1, 1, 1 }, [ 2 ] = { 2, 2, 2 }, [ 3 ] = { 3, 3, 3 }, } function idontgethowtodothis ( ) local x, y, z = unpack ( markerst [ 1 ] ) testarker = createMarker ( x, y, z ) addEventHandler ( "onMarkerHit", testarker, destroy ) end function destroy ( ) destroyElement ( testarker ) end Has to work.
Twiz. Posted November 7, 2012 Author Posted November 7, 2012 local markerst = -- Table with Coordinates { [ 1 ] = { 1, 1, 1 }, [ 2 ] = { 2, 2, 2 }, [ 3 ] = { 3, 3, 3 }, } function idontgethowtodothis ( ) local x, y, z = unpack ( markerst [ 1 ] ) testarker = createMarker ( x, y, z ) addEventHandler ( "onMarkerHit", testarker, destroy ) end function destroy ( ) destroyElement ( testarker ) end Has to work. no its still not working , i tryed alot and i still dont know why its not working . I just want to script something like a job >.<.
Twiz. Posted November 7, 2012 Author Posted November 7, 2012 I did it was only this , i just wanted to test if i see the Marker.
Castillo Posted November 7, 2012 Posted November 7, 2012 Oh, so you expected a function to execute on it's own? great. You must add either a command or a event handler, to test you can do this: local markerst = -- Table with Coordinates { [ 1 ] = { 1, 1, 1 }, [ 2 ] = { 2, 2, 2 }, [ 3 ] = { 3, 3, 3 }, } function idontgethowtodothis ( ) local x, y, z = unpack ( markerst [ 1 ] ) testarker = createMarker ( x, y, z ) addEventHandler ( "onMarkerHit", testarker, destroy ) end addEventHandler ( "onResourceStart", resourceRoot, idontgethowtodothis ) function destroy ( ) destroyElement ( testarker ) end
Twiz. Posted November 7, 2012 Author Posted November 7, 2012 Ahh sorry, i made a command handler , forgot that >.<.
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