Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to add blank line to webhook?

				local data = {
					['username'] = "SpeedCam",
					['content'] = Player.Name.." ".. " has been caught speeding!"..
					
					"Username: "..Player.Name..
					
					"Speed: "..tostring(math.floor(Touch.Velocity.Magnitude/2)) .. " sps in a " .. tostring(math.floor(Detector.Parent.SpeedLimit.Value)) .. " sps zone."}
				
					local newdata = HTTP:JSONEncode(data)
					HTTP:PostAsync(webhook, newdata)

I cant seem to figure out how to make this script leave a blank line in between of the contents. When i run it it gives me all the info in one line like this: "ifigil has been caught speeding!Username: ifigilSpeed: 43 sps in a 10 sps zone."

1 answer

✓ Accepted answer

You can use the newline control character if you want to be technical. This is a special character that instructs the following string to drop a line.

local HttpService = game:GetService("HttpService")

local SpeedLimit = Detector.Parent.SpeedLimit
local SPS = (Touch.Velocity.Magnitude / 2)

local Data = {
    ["username"] = "SpeedCam",
    ["content"] = Player.Name.." has been caught speeding!\n".. "\nSpeed: "..SPS.. " SPS in a "..math.floor(SpeedLimit.Value).. " SPS zone."
}

local DataPacket = HttpService:JSONEncode(Data)
HttpServicePostAsync(Webhook, DataPacket)

1 comment

0

Thanks this worked like supposed to

This discussion is preserved as it was. New answers, comments, and votes are closed.