Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Randomly Selecting a player as a Seeker?

Asked by 10 years ago

Im making a game called Squeak! and i want to know how to make a generator that randomly selects a player to be the Human/Seeker?

2 answers

Log in to vote
0
Answered by 10 years ago

I'm not sure if that can be consolidated at all, but it should work to the best of my knowledge. Feel free to comment with questions.

local players = game.Players:GetPlayers()
local num= math.random(#players )
local seeker = players[num]
Ad
Log in to vote
0
Answered by 10 years ago

my cousin got this bit of it:

function. selectSeeker()
    return game.Players:getChildren()[math.random(1,game.Players.NumPlayers)]
end
selectSeeker()

Answer this question