So i am trying to make a discord webhook thingy and the local script freaks out and says: Expected '}' (to close '{' at line 9), got '[' Can some of you fix this?
Localscript:
local WHU = "I will not allow you to make my bot text on my discord server, Also im not that dumb :|" local httpService = game:GetService("HttpService") local Players = game:GetService("Players") local Plr = Players.LocalPlayer local replicatedStorage = game:GetService("ReplicatedStorage") local remoteEvent = replicatedStorage:WaitForChild("Send") function Click() local data = { ['content'] = "Player "..Plr.Name.." has sended something!" ['embeds'] = [ ] } local finalData = httpService:JSONEncode(data) remoteEvent:FireServer(WHU, finalData) end script.Parent.MouseButton1Click:Connect(Click) --[[ { "content": "Player hasanchik sended something!", "embeds": [ { "description": "Hello. This is my final message.", "color": 16711680, "author": { "name": "hasanchik", "url": "https://web.roblox.com/users/388243015/profile", "icon_url": "https://tr.rbxcdn.com/5dccb86ea2be3852007a91c56f5dc00b/100/100/Avatar/Png" }, "footer": { "text": "PlayerId" } } ] } --]]
try
local WHU = "I will not allow you to make my bot text on my discord server, Also im not that dumb :|" local httpService = game:GetService("HttpService") local Players = game:GetService("Players") local Plr = Players.LocalPlayer local replicatedStorage = game:GetService("ReplicatedStorage") local remoteEvent = replicatedStorage:WaitForChild("Send") function Click() local data = { ['content'] = "Player "..Plr.Name.." has sended something!" ['embeds'] = {} } local finalData = httpService:JSONEncode(data) remoteEvent:FireServer(WHU, finalData) end script.Parent.MouseButton1Click:Connect(Click)
honestly i have no clue what this does but you ended the table wrong, this fixes the table part, so it might work
Method 1) On lines 11 and 12, you are making a table with [] instead of {}
Method 2) I am pretty sure another method would be to change lines 11 and 12 from this:
['embeds'] = [ ]
to this:
['embeds'] = []
You might also need replace [] to {} in method 2.
Oof, I forgot to use , .
local WHU = "I will not allow you to make my bot text on my discord server, Also im not that dumb :|" local httpService = game:GetService("HttpService") local Players = game:GetService("Players") local Plr = Players.LocalPlayer local replicatedStorage = game:GetService("ReplicatedStorage") local remoteEvent = replicatedStorage:WaitForChild("Send") function Click() local data = { ['content'] = "Player "..Plr.Name.." has sended something!", ['embeds'] = [ ], } local finalData = httpService:JSONEncode(data) remoteEvent:FireServer(WHU, finalData) end script.Parent.MouseButton1Click:Connect(Click)