So I am trying to make a dialogue GUI. The script is supposed to pick random players and have them say something but, the only plyer that is picked is the first player that joins. Here's the script that picks random players. If any other scripts need to be included, just tell me.
script
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)
local script
local dialogue = game.ReplicatedStorage:WaitForChild("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)
ping:Play()
wait()
end
end
dialogue.OnClientEvent:Connect(function(plr, speech, id)
player.Text = plr.Name
thumbnail.Image = id
Message(speech)
end)

4 comments
use game.Players:GetPlayers() instead and can you post the complete script
eyah for sure.
yeah*
also, game.Players:GetPlayers() didnt work..