Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago
Edited 6 years ago
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)

0
If you want to print out the value of that, it has to be outside the string rather than inside it. GoldenPhysics 474 — 6y
0
I understand, but how would I do that? DjinoKip 78 — 6y
0
"[[string stuff]] .. script.etc .. [[more string]] .. path.to.whatever" and so on. GoldenPhysics 474 — 6y
0
Thanks dude! DjinoKip 78 — 6y
0
^ Nevermind, didn't work at all. DjinoKip 78 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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!

0
Also, what website are you using to send this data? I could really use this. PyccknnXakep 1225 — 6y
0
^ Discord. DjinoKip 78 — 6y
0
Did my answer help? PyccknnXakep 1225 — 6y
Ad

Answer this question