Jump to content

Wont work


AlphaMark

Recommended Posts

Bad argument @ CrateMarker
crateMarker = createMarker(unpack(BoxPos[math.random(1,3)]),"cylinder") 

Error Because: because it was "CreateMarker"...and it hve to be "createMarker"

the name of what you call it, in this instance 'crateMarker' doesn't mean anything unless you use it in other place of your script.

The problem is because createMarker needs at least 3 functions:

createMarker(x,y,z) 

everything else is just the design, but as in your script you got:

createMarker(x,_,_,type) 

by '_' i represent that the arguments don't exists, so that's what you need to fix

Link to comment

manve1, that's just wrong.

He already has a table containing all the required arguments to the function. In order to properly split them in corresponding arguments, he has to use 'unpack' Lua function.

Therefore the way he performs the function is just right. I wonder if the table is correct however, so this is how it's supposed to be.

local BoxPos = { 
    {0, 0, 3}, 
    {0, 5, 3}, 
    {0, 10, 3} 
} 
  
local marker = createMarker(unpack(BoxPos[math.random(1,#BoxPos)])) 

If it really doesn't work, even though it should, then do it manually by passing in the specific table values in each argument you want to set.

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