Scripting Help Request [AutoRanker Using CookieTech Group Ranking Bot]

  • Hello :
    Greetings , I am a newbie scripter [I just started a few weeks ago] and I am trying to use Cookie’s Tech Group Ranking Bot , I would use it so that when a player stay longer in a game , that player would get ranked in the group. [For Example , every 5 Mins , the player would get ranked]

  • Notes :

  • Url / API / GroupID is correct
  • No output / F9 Error
  • My local minutes that is seen in code line 14 is working properly
  • Cookie is alive since I can manually use the heroku link to rank.
  • Heroku Logs : Nothing happen in the console log which means I forgot something (heroku is working but nothing happen with this code)
local HttpService = game:GetService("HttpService")
local url = "CENSORED/group/rank"
local APIKEY = "CENSORED"
local groupId = CENSORED
local plr = game.Players.LocalPlayer


function rankUser(plr,role_number)
	HttpService:GetAsync(url.."?user_name="..plr.Name.."&key=".. APIKEY.."&groupid=" ..groupId.."&role_number="..role_number)
end
	
game.Players.PlayerAdded:Connect(function(plr,role_number)

	local Minutes = plr:WaitForChild("leaderstats").Minutes
		
		if plr:IsInGroup(groupId) and plr:GetRankInGroup(groupId) >= 1 then 

			Minutes.Changed:Connect(function() 
				local role_number 
				if Minutes.Value >= 0 then 
					role_number=3 
				    rankUser(role_number) 
				elseif Minutes.Value >= 2 then 
					role_number=4 
				    rankUser(role_number)
				end
			end)

		end

	end)
  • Requesting Help :
    I’m pretty sure that this is not working due to my lack of skill in scripting and that is why I request someone to actually tell me what I did wrong and what is missing.

This is the code you created.

#1 instead of defining “roble_number” each time just put in the number. E.g, rankUser(3).

#2 Next of all it should be: rankUser(plr, 3) .

Make sure your group is sett correctly.

Add print statements so we can detect what is happening.

Also try to get back data.

function rankUser(plr,role_number)
	local response = HttpService:GetAsync(url.."?user_name="..plr.Name.."&key=".. APIKEY.."&groupid=" ..groupId.."&role_number="..role_number)
    local data = HttpService:JSONDecode(response)
    print(data.Body)
end


  • Thanks :
    I thank you for these advices that also helped me to understand more about functions , I added data back and it indeed worked but I found another issue.

  • Explanation :
    The script would check if minute has been updated , if yes , it would check the value of Minute to change the rank , but it only check the first requirement which is “>=0” , after that it won’t check about “>=2” like the player would get ranked “rank2” to “rank3” when requirements is meet but it stay in “rank2” , should I change it to “==” instead of “>=” ?

  • Codes :

local HttpService = game:GetService("HttpService")
local url = "CENSORED/group/rank"
local APIKEY = "CENSORED"
local groupId = CENSORED
local plr = game.Players


function rankUser(plr,role_number)
	local response = HttpService:GetAsync(url.."?user_name="..plr.Name.."&key=".. APIKEY.."&groupid=" ..groupId.."&role_number="..role_number)
	local data = HttpService:JSONDecode(response)
	print(data.Body)
end
	
game.Players.PlayerAdded:Connect(function(plr)

	local Minutes = plr:WaitForChild("leaderstats").Minutes
		
		if plr:IsInGroup(groupId) and plr:GetRankInGroup(groupId) >= 1 then 

			Minutes.Changed:Connect(function() 
				if Minutes.Value >= 0 then 
				    rankUser(plr,3) 
				elseif Minutes.Value >= 2 then 
			     	rankUser(plr,4)
			    elseif Minutes.Value >= 5 then 
				    rankUser(plr,5)
				end
			end)

		end
  • Logs :

  • Heroku Logs : We can see that it still try to rank for the first requirements


    (I can give a full log if wanted)

  • Additional Question : Does the cookie have to verified and uptated every “x” time or is there already something that manage to keep it alive / non-expired / uptated.

Cookies do expire.

Just, every 30 years.

The cookie will not be changed unless you attempt to login to the bot from your browser.

Maybe you could try to check if they’re already that rank & if they’re that rank then don’t rank them, but if they aren’t then rank them.


Feel free to mark your post as “Solution” if it fixes it.

I thank you for these advices , I actually found another way to fix it , but I thank you a lot for helping me.

1 Like

What was the other way?

  • Hello :
    Sorry for responding too late , my roblox account got hacked yesterday and I lost all of my robux and almost all of my game project has been stolen / deleted / taken down by roblox moderation team , I managed to keep my roblox group.

  • What I Tried :
    As I said , my skill in scripting is not that good and I tried what you told me to try but without results because of my lack of skills , so I tried to try other things and I actually made the code worse but managed to make it work as I wanted .

Instead of using “elseif” , I only used a lot of “if” and tried this :

			if Minutes.Value >= 0 and Minutes.Value <= 5 then 
				    rankUser(plr,3) 
                       end
			if Minutes.Value >= 5 and Minutes.Value <= 10 then 
				    rankUser(plr,4) 
                       end
  • Using this :
    I know that using this is really bad since it would make a request every time that Minutes is changed and will try to change role to user even if user already have rank : like last time , but It actually apply all requirements.
    I will improve this code and try what you told me to do when I have free time and when I will recover from losing my account.
1 Like

Good Idea, sorry for the loss of your account.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.