Phoenix-Roleplay Posted July 26, 2012 Share Posted July 26, 2012 Somehow this does not want to unpack properly yet, does at the same time.. local resppos = getElementData(theVehicle, "respawnposition") local x, y, z, rx, ry, rz = unpack(resppos) What I mean by this is, if I debug and tell it to output: "outputDebugString(x.." "..y.." "..z)" it outputs all the data. I even did if not x or not y or not z or not rx or not ry or not rz then outputDebugString("This is the issue here.") end and nothing was output so I put else outputDebugString("This is somehow the issue.") end and it output the data there. And when I look at the debug in game without any other debug I get this ERROR: bad argument #1 to 'unpack' (table expected, got boolean) Link to comment
Anderl Posted July 26, 2012 Share Posted July 26, 2012 getElementData is returning false. Link to comment
Phoenix-Roleplay Posted July 26, 2012 Author Share Posted July 26, 2012 getElementData is returning false. Not sure if you fully understood me but I did a outputDebugString and it returned the table outputDebugString(x.." "..y.." "..z.." "..rx.." "..ry.." "..rz) Link to comment
robhol Posted July 26, 2012 Share Posted July 26, 2012 If getElementData isn't returning a boolean, that error is impossible based on the code you've posted. As the error message says, unpack is getting a boolean, which means that that's what you got out. It's really hard to say any more without seeing more code. Link to comment
Phoenix-Roleplay Posted July 27, 2012 Author Share Posted July 27, 2012 Resolved. Needed to do a work around and pull the data like so: local respPosT = {0,0,0,0,0,0} local respPos = getElementData(theVehicle, "respawnposition") if (type(respPos) == "table")) then respPosT = respPos end local x, y, z, rx, ry, rz = unpack(respPosT) Link to comment
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