## Recommended Posts

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 , . . . . )
end

function destroy()
destroyElement( testarker )
end

```

```local x, y, z = markerst[1][1], markerst[1][2], markerst[1][3]
```

Make a loop to get each of them coordinates

Would be easier to use unpack.

```local x, y, z = unpack ( markerst [ 1 ] )
```

Would be easier to use unpack.
```local x, y, z = unpack ( markerst [ 1 ] )
```

Very nice... Very nice

I dont know if i´m doing something wrong but both wont work for me i dont see a Marker .

```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.

i have this problem 2

```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 >.<.

I did it was only this , i just wanted to test if i see the Marker.

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
```

Ahh sorry, i made a command handler , forgot that >.<.

## Create an account

Register a new account