I have an issue when I am trying to use HTTPService, it shows that there are too many requests.
Code:
local WebhookURL = --UrlGoesHere
local HTTPService = game:GetService("HttpService")
local Part = game.Workspace.TouchPart
while wait(5.5) do
Part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local playerName = hit.Parent:GetFullName()
local data = {
["Content"] = "Player Name: ".. playerName .." recieved admin!"
}
local finalData = HTTPService:JSONEncode(data)
HTTPService:PostAsync(WebhookURL, finalData)
end
end)
end
local WebhookURL = ""--UrlGoesHere
local HTTPService = game:GetService("HttpService")
local debounce = false
local Part = game.Workspace.TouchPart
Part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and debounce == false then
local playerName = hit.Parent:GetFullName()
debounce = true
local data = {
["Content"] = "Player Name: ".. playerName .." recieved admin!"
}
local finalData = HTTPService:JSONEncode(data)
HTTPService:PostAsync(WebhookURL, finalData)
wait(10) -- A countdown before the script run again.
debounce = false
else
print("Debounce is activated! Wait a little bit before trying again.")
end
end)
This is more of a question than an answer, because I am new to scripting in Roblox, but when I look up wait() it appears to be returning number, number instead of a boolean value (I don’t know if or how type conversions would be handled).
Whereas the while statement is probably looking for a boolean.
The error 429 is an error thrown when you exceed the rate limit of a service’s API and it is like a temporary ban from it. Your code runs in a while loop with a cooldown of 5.5 seconds which is evidently too low. Sending more requests while rate limited (in this case for discord) will get you a higher rate limit time. Increase the cooldown and try once your ban expires