05-22-2015, 02:46 AM
I'm guessing it's in the order the player's joined.
What you can do is get the number of players, create a random number between 0 and that number, and then take player <nr> from that number.
Get a random x, y, z in a loaded chunk without loading it? Whut? Assuming you meant unloaded chunk. Can't you just use:
What you can do is get the number of players, create a random number between 0 and that number, and then take player <nr> from that number.
-- NumPlayers is for example 10 local RandomPlayer = math.random(NumPlayers) local CurrentPlayer = 0 World:ForEachPlayer( function() CurrentPlayer = CurrentPlayer + 1 if (CurrentPlayer == RandomPlayer) then --- Do things return true -- we did what we wanted with the player end end )
Get a random x, y, z in a loaded chunk without loading it? Whut? Assuming you meant unloaded chunk. Can't you just use:
local X = math.random(15) local Y = math.random(255) local Z = math.random(15)