need help,
local speechName = game.StarterGui.ScreenGui.guiSpeech
local DataStore = game:GetService("DataStoreService")
local DataName = DataStore:GetDataStore("SaveNames")
local RandomNames = {"Charlie","Georgia","Sam","Kira","Poke","Robin","Josh","Logan","Luca","Wade","Matthew","Caleb","Jayden","Max","Harvey",}
game.Players.PlayerAdded:Connect(function(Player)
local RandName = RandomNames[math.random(#RandomNames)]
local PlrName = Instance.new("StringValue", Player)
PlrName.Name = "PlrName"
PlrName.Value = DataName:GetAsync(Player.UserId) or RandName
DataName:SetAsync(Player.UserId, PlrName.Value)
end)
game.Players.PlayerRemoving:Connect(function(player)
DataName:SetAsync(player.UserId, player.PlrName.Value)
end)
if RandomNames == "Sam" then
wait(13)
speechName.Text = "S"
wait(0.6)
speechName.Text = "Sa"
wait(0.6)
speechName.Text = "Sam"
wait(0.6)
speechName.Text = "Sam!"
end
this script will give the player a random name and through datastore it will save that name. that is all fine but at the bottom there is a if statement that will change text in a text label to the players name. this does. not work. anyone wanna help with a fix?

2 comments
This question is duplicated. https://scriptinghelpers.org/questions/89496/need-help-with-this-how-do-i-fix-this-random-name-dialogue
Your changing the StarterGui's GUI, NOT the player's