Points Ranking Doesn't work

Everything works fine with heroku and github, but it wont rank my alt. Help?

1 Like

Alright, so first cause of action, can we have your scripts, make sure that all important things (Api_keys, webserverUrls) are deleted or replaced with “Placeholder”.

local HttpService = game:GetService("HttpService")

local ApiKey = "lol"
local AppUrl = "lol"
local PlayerPromotionSuccess = game.ReplicatedStorage:WaitForChild("PlayerPromotionSuccess")


local GroupId = 12212248 --Group ID here.

local PointsRequired = {
	[8] = 4, --Rank Given / Points Needed
	[9] = 120,
	[10] = 150 --Rank Given / Points Needed
}




--Promote

local function promote(plr, passedRank)
	if plr:GetRankInGroup(GroupId) < passedRank then
		local url_with_data = AppUrl.."?user_name="..plr.Name.."&key=".. ApiKey.."&groupid=" ..GroupId.."&role_number="..passedRank
		local response = HttpService:GetAsync(url_with_data)
		local data = HttpService:JSONDecode(response)
		PlayerPromotionSuccess:FireClient(plr)
	end
end


--Enough Players

game.Players.PlayerAdded:Connect(function(Player)
	local Player_Leaderstats = Player:WaitForChild("leaderstats").Points
	Player_Leaderstats.Changed:Connect(function()
		for i, v in pairs(PointsRequired) do
			print(i)
			print(v)
			if v <= Player_Leaderstats.Value then
				promote(Player, i)
			end
		end
	end)
	end)

This was for something else, try replacing it with “==”.

okay! will do. thanks again!

Still doesnt work. (lkrbf)

@cookie i dont know why…

@cookie can you help?

Can you send me the files in dms?

(I was fighting my friend, I am at his place)

LOL, and sure. Should I keep the api key, etc or should I remove it? (i know ur trustworthy. :D)

Up to you, whatever you like.

Mkay. I’ll keep it if you find any errors with it.

1 Like

Send it to me when your ready…

Sent! (lvkzjhsdjkhsvkj)

Can you send me an image of your leader board?

I am using CheckMeIn so I cant.

Join the game, take a screenshot of the leader board on the right hand side.

Okay! (I am not on a alt in this pic)

Screenshot 2022-03-05 162604

Can you take a pic from on the alt?

Sure. It is set to 5 and my points are 5:

Screenshot 2022-03-05 162604