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

Why is my webhook printing ..script.Parent.Frame.Plane.Text instead of the text?

local url = "No." 
local http = game:GetService("HttpService")
local HookData = {
--- This part
['username'] = "DELTA FLIGHT ALERT", 
['content'] = ([[|=+=+**DELTA FLIGHT ALERT**+=+=|
				 

**FLIGHT INFORMATION:**
PLANE:                  ..script.Parent.Frame.Plane.Text
FLIGHT NUMBER: 		..script.Parent.Frame.FlightNumber.Tex
GATE:					..script.Parent.Frame.Gate.Text
AIRPORT:             ..script.Parent.Frame.Airport.Text        
DEPARTURE TIME:]])..script.Parent.Frame.DepTime.Text	   
}

HookData = http:JSONEncode(HookData)

script.Parent.Frame.Send.MouseButton1Click:connect(function()
	http:PostAsync(url, HookData) -- And we are done :D
end)

5 comments

0

If you want to print out the value of that, it has to be outside the string rather than inside it.

0

I understand, but how would I do that?

0

"[[string stuff]] .. script.etc .. [[more string]] .. path.to.whatever" and so on.

0

Thanks dude!

0

^ Nevermind, didn't work at all.

1 answer

✓ Accepted answer

As GoldenPhysics said, you need to put the value outside of the string:

local url = "No." 
local http = game:GetService("HttpService")
local HookData = {
['username'] = "DELTA FLIGHT ALERT", 
['content'] = ([[|=+=+**DELTA FLIGHT ALERT**+=+=|

**FLIGHT INFORMATION:**
PLANE: ]]..script.Parent.Frame.Plane.Text..[[
FLIGHT NUMBER: ]]..script.Parent.Frame.FlightNumber.Text..[[
GATE: ]]..script.Parent.Frame.Gate.Text..[[
AIRPORT: ]]..script.Parent.Frame.Airport.Text..[[      
DEPARTURE TIME: ]]..script.Parent.Frame.DepTime.Text
)  
}

HookData = http:JSONEncode(HookData)

script.Parent.Frame.Send.MouseButton1Click:connect(function()
    http:PostAsync(url, HookData) -- And we are done :D
end)

This should work for you and If it didn't please comment. Otherwise, please accept my answer!

3 comments

0

Also, what website are you using to send this data? I could really use this.

0

^ Discord.

0

Did my answer help?

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