Can someone help me and explain why its not working

local Http = game:GetService("HttpService") -- HTTP Service
 
--[[ LOCALS ]]--
 
local APIURL = "https://rbx-manager-2-1.oji-hajimeyumul.repl.co/" -- I'll give the api url later
local DiscordWebhook = "" -- Discord URL
local APIKEY = "" -- I'll setup this
 
local Group = 32366337 -- GROUP ID
 
local date = os.date("!*t") -- Getting The Date
 
--[[ FUNCTIONS ]]--
 
function rankUser(UserId) -- Rank user function.
	Http:GetAsync(APIURL.."promote/"..APIKEY.."/32366337/"..UserId) -- Ranking them online. 
end
 
game.Players.PlayerAdded:Connect(function(player)
	local exp = player:WaitForChild("RankingSystem"):WaitForChild("Exp")
 
	local Data = {
		["content"] = player.Name.." ,was just ranked. | "..date.month.."/"..date.day.."/"..date.year
	}
	Data = Http:JSONEncode(Data)
 
 
	if player:IsInGroup(Group) and player:GetRankInGroup(Group) >= 1 then
		exp.Changed:Connect(function()
			local expValue = exp.Value
 
			if expValue >= 25 and player:GetRankInGroup(Group) < 2 then
				rankUser(player.UserId)
				Http:PostAsync(DiscordWebhook, Data)
			elseif expValue >= 65 and player:GetRankInGroup(Group) < 3 then
				rankUser(player.UserId)
				Http:PostAsync(DiscordWebhook, Data)
			elseif expValue >= 100 and player:GetRankInGroup(Group) < 4 then
				rankUser(player.UserId)
				Http:PostAsync(DiscordWebhook, Data)
			elseif expValue >= 190 and player:GetRankInGroup(Group) < 5 then
				rankUser(player.UserId)
				Http:PostAsync(DiscordWebhook, Data)
			elseif expValue >= 230 and player:GetRankInGroup(Group) < 6 then
				rankUser(player.UserId)
				Http:PostAsync(DiscordWebhook, Data)
			elseif expValue >= 300 and player:GetRankInGroup(Group) < 7 then
				rankUser(player.UserId)
				Http:PostAsync(DiscordWebhook, Data)
			elseif expValue >= 375 and player:GetRankInGroup(Group) < 8 then
				rankUser(player.UserId)
				Http:PostAsync(DiscordWebhook, Data)
			elseif expValue >= 425 and player:GetRankInGroup(Group) < 9 then
				rankUser(player.UserId)
				Http:PostAsync(DiscordWebhook, Data)
			elseif expValue >= 500 and player:GetRankInGroup(Group) < 10 then
				rankUser(player.UserId)
				Http:PostAsync(DiscordWebhook, Data)
			elseif expValue >= 590 and player:GetRankInGroup(Group) < 11 then
				rankUser(player.UserId)
				Http:PostAsync(DiscordWebhook, Data)
			elseif expValue >= 800 and player:GetRankInGroup(Group) < 13 then
				rankUser(player.UserId)
				Http:PostAsync(DiscordWebhook, Data)
			elseif expValue >= 950 and player:GetRankInGroup(Group) < 14 then
				rankUser(player.UserId)
				Http:PostAsync(DiscordWebhook, Data)
			elseif expValue >= 1000 and player:GetRankInGroup(Group) < 15 then
				rankUser(player.UserId)
				Http:PostAsync(DiscordWebhook, Data)
			elseif expValue >= 1250 and player:GetRankInGroup(Group) < 16 then
				rankUser(player.UserId)
				Http:PostAsync(DiscordWebhook, Data)
			elseif expValue >= 1440 and player:GetRankInGroup(Group) < 17 then
				rankUser(player.UserId)
				Http:PostAsync(DiscordWebhook, Data)
			end
		end)
	end
end)
1 Like

Potential issues

  1. The URL you are hitting with Http:GetAsync() in your rankUser function could be incorrect or the server at the receiving end of the URL might not exist or might not be processing your request properly. To troubleshoot this, You’d need to verify if the API at the URL is working correctly via Postman or any other API testing tool.

  2. You must enable HttpService.

  3. Change Discord Webhook to Guilded Webhook (first one is no longer supported).

  4. The date is only calculated when the script is run, meaning that the date will never update. You should place the date calculation inside the PlayerAdded event listener so it will update each time a player joins.

  5. Ensure the player has the “RankingSystem” and “Exp” instances existing within. If they don’t, the script will fail.

i think discord webhook proxy will work

Hello, can you share any updates?