AlphaMark Posted November 28, 2013 Posted November 28, 2013 Okay so i have this: CrateMarker = createMarker(unpack(BoxPos[math.random(1,3)])) And it creates an big blue marker while i want an cylinder marker.
manawydan Posted November 28, 2013 Posted November 28, 2013 try CrateMarker = createMarker(unpack(BoxPos[math.random(1,3)]),"cylinder")
LiOneLMeSsIShoT Posted November 28, 2013 Posted November 28, 2013 Bad argument @ CrateMarker crateMarker = createMarker(unpack(BoxPos[math.random(1,3)]),"cylinder") Error Because: because it was "CreateMarker"...and it hve to be "createMarker"
manve1 Posted November 28, 2013 Posted November 28, 2013 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
myonlake Posted November 29, 2013 Posted November 29, 2013 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.
manve1 Posted November 29, 2013 Posted November 29, 2013 I didn't look at the first post correctly, but I still don't see anything about "table", this time it is my own fault, but for recommendation towards AlphaMark, i would include anything that is used towards the same function.
TAPL Posted November 29, 2013 Posted November 29, 2013 local x, y, z = unpack(BoxPos[math.random(#BoxPos)]) CrateMarker = createMarker(x, y, z, "cylinder")
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