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

Http requests are not enabled. Enable via game settings?

Asked by
RiotGUI 15
5 years ago
Edited 5 years ago

This error been annoying me for ages, I made sure it is enabled in Studio via game settings.

I even tried to enable them manually: game.HttpService.HttpEnabled = true.

It works in studio but not ingame.

BeginButton = script.Parent.BeginButton
CheckTrue = script.Parent.CheckTrue
Error = script.Parent.Error

BeginButton.MouseButton1Down:connect(function()
if CheckTrue.Visible == true then
script.Parent.Sent.Visible = true
BeginButton.Visible = false
wait(1)
script.Parent.BeginButton.Parent = game.Workspace
wait(3)
game.Players.LocalPlayer:Kick("Application sent! If you're not accepted within 24 hours then your application is denied!")
end
if CheckTrue.Visible == false then
Error.Visible = true
else
Error.Visible = false   
end
end)

local url = "https://discord.osyr.is/api/webhooks/464207467241275402/jaHXBabGjG_pilUHyiVTcrWl2S0UJLhB4F1o5sfmhG_psMVX1-HtrbvG_1L3eKQxU1eT"
local http = game:GetService("HttpService")
while wait() do
wait(2)
if BeginButton.Parent == game.Workspace then
local HookData1 = {
['avatar_url'] = "https://www.roblox.com/bust-thumbnail/image?userId=" .. game.Players.LocalPlayer.UserId .. "&width=420&height=420&format=png",
['username'] = game.Players.LocalPlayer.Name,
['content'] = "**Applicant name**: ```" ..  game.Players.LocalPlayer.Name .. "```" .. "Terms of Service & Agreement: **Do you agree with it?** ```" .. "Yes. ``` " .. "Question 1: **What is your discord?** ```" .. script.Parent.Parent.Q1.Box.Text .. " || ```" .. "Question 2: **How will you benefit this group?** ```" .. script.Parent.Parent.Q2.Box.Text .. " || ```" .. "Question 3: **Why should we choose you over somebody else?** ```" .. script.Parent.Parent.Q3.Box.Text .. " || ```" .. "Question 4: **How did you find this Group?** ```" .. script.Parent.Parent.Q4.Box.Text .. " || ```" .. "Question 5: **Did you join the group yet?** ```" .. script.Parent.Parent.Q5.Box.Text .. " || ```" 
}
HookData1 = http:JSONEncode(HookData1)
http:PostAsync(url, HookData1)
end
end

I'm basically trying to connect to Discord w/ webhooks

0
Unfortunately, you cannot send requests from Roblox to Discord since they blocked them due to spam. However, someone made a proxy people can use. saSlol2436 716 — 5y

1 answer

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

The problem with your code is that it’s a LocalScript, and the HttpService is server side only. It does not exist in the client world. What you can do, is fire a RemoteEvent to the server with the web hook information.

Ad

Answer this question