Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[SOLVED BY ORIGINAL POSTER] "Expected '}' to close '{' at line 12), got 'Color'" How to fix this?

I was following a tutorial on how to make a custom dialogue system and I pretty much copied everything the video did but it's still wrong. Video for context: https://www.youtube.com/watch?v=lux4emzbkHg&t=858s

for i,x in pairs(game.Workspace.NPCs:GetChildren()) do
	x.Region.Touched:connect(function(hit)
		if hit.Parent:FindFirstChild("Humanoid") then
			local tab = {}
			for o,p in pairs(x.Quest:GetChildren()) do
				for s,q in pairs(p:GetChildren())
				local texttab = {
					Text = q.Value.." ",
					Colored = {},
				}
				for v,r in pairs(q.Colored:GetChildren()) do
					local colortab = {
						Word = r.Name.." "
						Color = r.Value,
					}
					table.insert(texttab.Colored,colortab)
				end
				table.insert(tab,texttab)
			end
			game.ReplicatedStorage.NPCSpeak:FireClient(game.Players[hit.Parent.Name],tab)
		end
	end)
end

Color on line 14 says "Expected '}' to close '{' at line 12), got 'Color'"

2 comments

0

for i,x in pairs(game.Workspace.NPCs:GetChildren()) do 02 x.Region.Touched:connect(function(hit) 03 if hit.Parent:FindFirstChild("Humanoid") then 04 local tab = {} 05 for o,p in pairs(x.Quest:GetChildren()) do 06 for s,q in pairs(p:GetChildren()) 07 local texttab = { 08 Text = q.Value.." ", 09

0

oops nvm

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.