I'm currently developing a chat GUI for my game, it works, but it doesn't, if that makes sense.
Creates the storage (Works)
local storage = Instance.new("Folder",workspace)
storage.Name = "Chat"
local number = 1
repeat
local value = Instance.new("StringValue",workspace.Chat)
value.Name = "Line"..number
number = number + 1
wait()
until #game.Workspace.Chat:GetChildren() == 7
Change the GUI Text (Doesn't work)
game.Workspace.Chat.Line1.Changed:connect(function()
script.Parent.Line1.Text = game.Workspace.Chat.Line1.Value
script.Parent.Line2.Text = game.Workspace.Chat.Line2.Value
script.Parent.Line3.Text = game.Workspace.Chat.Line3.Value
script.Parent.Line4.Text = game.Workspace.Chat.Line4.Value
script.Parent.Line5.Text = game.Workspace.Chat.Line5.Value
script.Parent.Line6.Text = game.Workspace.Chat.Line6.Value
script.Parent.Line7.Text = game.Workspace.Chat.Line7.Value
end)
Update the values (Doesn't work)
local player = game.Players.LocalPlayer
player.Chatted:connect(function(chatted)
game.Workspace:FindFirstChild("Chat").Line2.Value = game.Workspace:FindFirstChild("Chat").Line1.Value
game.Workspace:FindFirstChild("Chat").Line3.Value = game.Workspace:FindFirstChild("Chat").Line2.Value
game.Workspace:FindFirstChild("Chat").Line4.Value = game.Workspace:FindFirstChild("Chat").Line3.Value
game.Workspace:FindFirstChild("Chat").Line5.Value = game.Workspace:FindFirstChild("Chat").Line4.Value
game.Workspace:FindFirstChild("Chat").Line6.Value = game.Workspace:FindFirstChild("Chat").Line5.Value
game.Workspace:FindFirstChild("Chat").Line7.Value = game.Workspace:FindFirstChild("Chat").Line6.Value
game.Workspace:FindFirstChild("Chat").Line1.Value = chatted
end)
For example, say if I say "Howdy", the gui will change to
Howdy
*Blank*
*Blank*
*Blank*
*Blank*
*Blank*
*Blank*
But if I then say "Helllo", it will change to
Helllo
Howdy
Howdy
Howdy
Howdy
Howdy
Howdy
How would I fix this?
