Hey recently I’ve been working on a TextBox where you can create a team with that specific text in the textbox and I am trying to make it loggable but it is giving me the error.
HTTP 400 (Bad Request)
Could someone help me, thanks.
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(Player,text)
local team1 = Instance.new("Team")
team1.Parent = game.Teams
team1.Name = tostring(text)
team1.TeamColor = BrickColor.Random()
Player.Team = team1
print("Team "..text.. " created by "..Player.Name)
local webhook = "1"
local teamLogData =
{
['contents'] = "",
['embeds'] = {{
['title'] = "__**Team Creation Logs**__",
['description'] = "**A new Team has been created!**",
['type'] = "rich",
['color'] = tonumber(14177041),
['fields'] = {
['name'] = "Player Name",
['value'] = Player.Name,
['inline'] = true
},
{
['name'] = "Team Name",
['value'] = team1.Name,
['inline'] = true
}
}}
}
local newData = HttpService:JSONEncode(teamLogData)
HttpService:PostAsync(webhook,newData)
end)