Jump to content

Need help


AlphaMark

Recommended Posts

Hey, I made a script containing this:

  
local route = { 
{283.33124, 1409.90393, 10.40879}, 
{-1970.61511, -859.24579, 32.02344}, 
{-2324.64600, -1653.37061, 483.70313}, 
{2799.31885, 2582.04321, 10.82031}, 
{2745.05957, -2431.14282, 13.65159} 
} 
  

and this in a function:

currentIndex = math.random(1,#route) 
marker = createMarker(unpack(route[currentIndex]), 'checkpoint', 2, 255, 255, 0, 255) 

Though it is not working, It is not creating a marker

Link to comment

Have you checked '/debugscript', and honestly have you checked all locations to make sure there isn't any marker? There are three things that might be wrong, 1. 'marker' is also a class and can't be used as a variable. 2. The amount of arguments returned by unpack may be wrong, one way is to make that value more constant the way below:

local x,y,z = unpack(route[currentIndex]) 
theMarker = createMarker(x,y,z,"checkpoint", 2, 255, 255, 0, 255) 

3. replace (') with ("), not sure about lua but in other languages (') often represent char instead of string, char can only hold one symbol.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...