Script scripted correctly, but does not work

Acknwoledgements, I am making a panel for my commission group for my staff members;

Although, when I attempted to script the webhook system, it does not worked. Even though, I made sure that everything was correct, correctly scripted and put together. Still no luck, any help! Thank you!

Local script:

script.Parent.StaffPanel.AnnounceCommsOpen.MouseButton1Click:Connect(function()
	game.ReplicatedStorage.events.secondaary:FireServer()
end)


Serverscript:

local httpservice = game:GetService("HttpService")
local announcer = "webhook"


game.ReplicatedStorage.events.secondaary.OnServerEvent:Connect(function(plr, commission)
	
	if commission == "AnnounceCommissionsOpen" then
		local Data = {
			['embeds'] = {
				["tiitle"] = "sam's commission notifier",
				["description"] = "Ahoy, commissions are now open, if you are interested in ordering from Sam, goto #tickets!"
			}
		}
		Data = httpservice:JSONEncode(Data)
		httpservice:PostAsync(announcer, Data)
	end
end)
game.ReplicatedStorage.events.secondaary:FireServer() -- you forgot to add the first arg
1 Like

It looks fine. It should get to this line
if commission == "AnnounceCommissionsOpen" then
and then stop because commission is nil, but otherwise it looks good.

1 Like

There’s no argument here, since there isn’t the information won’t be passed onto the server

1 Like

Ah, so do i put :FireServer(plr, commission)

1 Like

Ensure HttpRequests are enabled as well.
Game Settings > Security > Allow HTTP requests (if you haven’t done this already)

1 Like

Thank you, but HTTP request are already on, this was an issue beforehand with another script although thank you. x

2 Likes

Put :FireServer(commission) – Roblox handles the first arg

1 Like

Do I have to variable is as it is underlined?

1 Like

The player when using FireServer is already the first parameter. So you would just do

:FireClient(commission)

EDIT: @saouvs do you have a commission variable? What specifically do you want to pass to the server?

I have a server script + a local script, inside the server script is where the webhook data information is kept, which is also provided above.

The local script holds, where if you press the button that data from the server script will post into the discord server channel.

:FireServer(ā€œAnnounceCommissionsOpenā€)

No luck, still.

I have asked an experienced scripter and he doesn’t see what is wrong with the script.

Aha, I have gotten an error, I’ve made sure that HTTP requests are on.

image

could be because of this typo. try changing it.

Ah, that should fix it! Let me test right now.

Nope, I’m aware of the typo and have fixed it. I keep getting ā€˜HTTP 400’ Bad request, and brings me to line 15.

embeds is an array of Embed Objects, not an Embed Object.

I’ll fix that now, I’ll let you know if that works.

EDIT: Script does not work, still Same error, image

Please provide your current script.