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

need help with this, how do i fix this? (random name -> dialogue)

Asked by
IIStxer -5
4 years ago
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

need help, this script is supposed to give a random name to a player that will save. so far that works but as i am doing dialog as in a cutscene for some reason i cannot change the text of the dialogue along to the name of the character anybody help?

Answer this question