Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you make a random person talk in gui?

How do you do the thing like camping they choose a random player to talk in gui how do i do this (help)?

2 comments

0

You mean a dialog system?

0

no the gui

1 answer

If your asking how to get a random player, this is it.


math.randomseed(tick())

if #game.Players:GetPlayers() > 0 then
	local rand = math.random(1,#game.Players:GetPlayers()) -- The # is used to get the amount of inputs in a table.
	local randomplayer = game.Players:GetPlayers()[rand] -- Returns an objectvalue for player.
	
	print(randomplayer)
end

Please note, put this script inside a function or a disabled script, as when you press test, or on Roblox itself, the server starts before the client, and before the client joins the script would have already ran.

(Tested and works)

Now as for setting up a GUI, you will just have to use the information from the player to create it.

This discussion is preserved as it was. New answers, comments, and votes are closed.