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

Expected '}' to end '{'?

Asked by 5 years ago

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

Log in to vote
-2
Answered by 5 years ago
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
0
Now it's giving me the same error but on line 18 saying " '}' expected to close '{' at line 16" Superameno 34 — 5y
0
@Superamano you forgot the ";" on the name. IrishStukov 20 — 5y
0
that isn't needed in lua theking48989987 2147 — 5y
0
lol it is; if its not there it will think the field ended. IrishStukov 20 — 5y
View all comments (3 more)
0
Thanks IrishStukov, it worked! Superameno 34 — 5y
0
np IrishStukov 20 — 5y
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. EzraNehemiah_TF2 3552 — 5y
Ad

Answer this question