I am looking for someone who is able to help me make a script that selects a random player from the player list. I also want the script to get their avatar and username. I was using a local player script but then I realized that the player would see their own avatar instead of random players.
I made a little example of the GUI design.
Link to design: http://prntscr.com/olrdta
Where it says "name" I want it to select a random player from the players list and display their avatar and name.
The black border is where the random avatar image will appear.
The name text is where the random players name will appear.
This is for roblox btw.
Okay Make a ****RemoteEvent**** Call it Dialogue Put it in ReplicatedStorage And Make a ****Script**** Here's a script: l
local dialogue = game.ReplicatedStorage.Dialogue local type = Enum.ThumbnailType.HeadShot local size = Enum.ThumbnailSize.Size180x180
function Message(player, speech, id) dialogue:FireAllClients(player, speech, id) end wait(5) local players = game.Players:GetChildren() local player = players[math.random(1, #players)] local id = game.Players:GetUserThumbnailAsync(player.UserId, type, size) Message(player, "Example Here", id)
And Heres a local script in the gui
local dialogue = game.ReplicatedStorage.Dialogue local frame = script.Parent.Frame local thumbnail = frame.Thumbnail local text = frame.Dialogue local player = thumbnail.Player
function Message(speech) for i = 1, #speech do text.Text = string.sub(speech, 1, i) wait() end end
dialogue.OnClientEvent:Connect(function(plr, speech, id) player.Text = plr.Name thumbnail.Image = id Message(speech) end)