So I'm making a webhook that posts if someone was temporarily banned for exploiting, and my code works, except that there is no space between the username and the message. I thought the way to do this was ".." but it doesn't seem to be working.
Code:
local url = "my url but not included here"
local http = game:GetService("HttpService")
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
local newmsg = plr.Name .. "was temporarily banned for exploiting from CUBE Sim" --not working
local data = {
["username"] = "Exploit Alert",
["content"] = newmsg
}
local newdata = http:JSONEncode(data)
http:PostAsync(url, newdata)
end)
end)
New code:
local url = "my url but not included here"
local http = game:GetService("HttpService")
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
local name = plr.Name
local smsg = " was temporarily banned for exploiting in CUBE Sim"
local newmsg = name .. smsg
local data = {
["username"] = "Exploit Alert",
["content"] = newmsg
}
local newdata = http:JSONEncode(data)
http:PostAsync(url, newdata)
end)
end)
here is what it puts: https://gyazo.com/617bdeac073576dfb6824878dd1948c5
(it still runs on "plr.Chatted" because I havent implemented it into the game yet, don't mind that)

2 comments
Put a space after where it says
["Username"]do " "