-- Step 1: Setup a table of positions:
local positions = {
{270,-110,6}, -- this is a table with 3 numbers in it, X, Y, and Z coordinates.
-- You can add more tables here, I don't know a lot of coordinates by memory.
}
-- Step 2: Get a random position:
local tableSize = table.getn(positions) -- table.getn basically gets the size of a table, and we store that value in a variable
local i = math.random(1,tableSize) -- math.random gets a random value between 2 numbers (inclusive), we use 1 and the size of the table here
local position = positions[i] -- get one of the position tables from the table of positions using the random index
-- Step 3: Use the randomly selected table as a ped position:
local ped = PedCreateXYZ(4,position[1],position[2],position[3]) -- position[1] is the first value in the table we got, the X coord, position[2] is the Y, and position[3] the Z