harryh Posted May 4, 2014 Share Posted May 4, 2014 I want to return x, y ,z from a table and then it will create a ped in a random location. this is what i have gPedLocations = { { 1932.1513671875, -1773.64453125, 13.3828125 }, { 1937.0458984375, -1786.009765625, 13.390598297119 } } function createThePed() local x, y, z = gPedLocations[ math.random(#gPedLocations) ] Link to comment
Castillo Posted May 4, 2014 Share Posted May 4, 2014 Unpack the table with "unpack". local x, y, z = unpack ( gPedLocations [ math.random ( #gPedLocations ) ] ) 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