It keeps erroring HTTP 404 (Not Found).
Why? Does this mean the UserId of the play doesn’t exist or something?
Edit: this is the new script, it worked ONCE, and now just doesn’t work, I didn’t change anything? Can someone help me? It prints “it worked”
local apiBase = "https://roblox.rocketpanel.io/roblox/bots"
local function http(loaderId, endpoint, method, body)
if (body) then
body = HttpService:JSONEncode(body)
end
local success, message = pcall(function()
local newURL = apiBase .. '/' .. loaderId .. endpoint
local Response = HttpService:RequestAsync({
Url = newURL,
Method = method,
Headers = {
["Content-Type"] = "application/json" -- When sending JSON, set this!
},
Body = body
});
return HttpService:JSONDecode(Response.Body)
end)
if (not success) then
return {success = false, response = message}
else
print(message, ' it worked!')
return message;
end
end
local loaderid = "loaderid goes here"
local endpoint = "rankingroup"
local method = "POST"
local body = {["userId"] = playerToBeRanked.UserId, ["rankId"] = RoleId}
http(loaderid, endpoint, method, body)