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

Expected '}' to end '{'?

I am getting that error in this code at line 8: http://prntscr.com/leehd1

The code is below:

local http = game:GetService("HttpService")
local url = 'snipped'

game.Players.PlayerAdded:Connect(function(player)
	local data = {
					embeds = {{
						title = '';
						description = 'https://www.roblox.com/users/'player.UserId'/profile';
						color = 8376188;
						fields = {
									{
										name = '***USERNAME***';
										value = player.Name;
										inline = true
									};
									{
										name = '***LEVEL CLEARANCE***'
										value = "Not working until guy makes the group";
										inline = true
									};
									{
										name = '***DIVISIONAL RANK***';
										value = "Not working until guy makes the divisions";
										inline = false
									};
									{
										name = "***SESSION LENGTH***";
										value = "Work in progress";
										inline = true
									}
								}
							}}
						}
						local transmit = http:JSONEncode(data)
						http:PostAsync(url,transmit)
end

I don't know why its giving me that error when all of my brackets match up.

1 answer

local http = game:GetService("HttpService")
local url = 'snipped'

game.Players.PlayerAdded:Connect(function(player)
    local data = {
                    embeds = {{
                        title = '';
                        description = 'https://www.roblox.com/users/'..player.UserId..'/profile'; --I think u just forget the ..
                        color = 8376188;
                        fields = {
                                    {
                                        name = '***USERNAME***';
                                        value = player.Name;
                                        inline = true
                                    };
                                    {
                                        name = '***LEVEL CLEARANCE***'
                                        value = "Not working until guy makes the group";
                                        inline = true
                                    };
                                    {
                                        name = '***DIVISIONAL RANK***';
                                        value = "Not working until guy makes the divisions";
                                        inline = false
                                    };
                                    {
                                        name = "***SESSION LENGTH***";
                                        value = "Work in progress";
                                        inline = true
                                    }
                                }
                            }}
                        }
                        local transmit = http:JSONEncode(data)
                        http:PostAsync(url,transmit)
end

7 comments

0

Now it's giving me the same error but on line 18 saying " '}' expected to close '{' at line 16"

0

@Superamano you forgot the ";" on the name.

0

that isn't needed in lua

0

lol it is; if its not there it will think the field ended.

0

Thanks IrishStukov, it worked!

0

np

0

Answers should come with explanations. If you are just going to modify the script and post it in answers, you should the fixed line in the comments instead.

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