Rank Center not working for me

Hey developers,

I am stressing it out how the script doesn’t work, however the output or console doesn’t show the error!

local MarketplaceService = game:GetService("MarketplaceService")
local ID = 10614376

script.Parent.MouseButton1Click:Connect(function()
	if true then
		wait(0.5)
		script.Parent.GetRank.Text = "LOADING."
		wait(0.5)
		script.Parent.GetRank.Text = "LOADING.."
		wait(0.5)
		script.Parent.GetRank.Text = "LOADING..."
		wait(0.5)
	end
	wait(2)
	if true then
		wait(0.5)
		script.Parent.GetRank.Text = "CHECKING."
		wait(0.5)
		script.Parent.GetRank.Text = "CHECKING.."
		wait(0.5)
		script.Parent.GetRank.Text = "CHECKING..."
		wait(0.5)
	end
	wait(5)
game.Players.PlayerAdded:Connect(function(player)
		  if game:GetService("GamePassService"):PlayerHasPass(player, ID) then
			script.Parent.GetRank.Text = "YOUR RANK HAS BEEN UPDATED!"
			game.ReplicatedStorage.GetRank2:FireServer()
			wait(3)
			game:GetService("TeleportService"):Teleport(5302266534)
		else
			script.Parent.GetRank.Text = "LOOK LIKE YOU DO NOT OWN THE GAMEPASS!"
			wait(3)
			game.Players.LocalPlayer:Kick("You do not own the gamepass! Come back when you purchase it!")
		end
	end)
end)

For the ServerScriptService:

local GlitchURL = "censored" --Place the glitch project URL inside of the quotes
         
        function rankUser(UserId, RoleId)
            game:GetService("HttpService"):GetAsync(GlitchURL .. "ranker?userid=" .. UserId .. "&rank=" .. RoleId)
        end
     
     local MarketplaceService = game:GetService("MarketplaceService")
     
     
    local Configuration = {
    	{10614388, 5},
    }
     
    game.ReplicatedStorage.GetRank.OnServerEvent:Connect(function(Player)
        for i = 1, #Configuration do
            local GamepassId = Configuration[i][1]
    		        local RankId = Configuration[i][2]
            
            if MarketplaceService:UserOwnsGamePassAsync(Player.UserId, GamepassId) then
                print("Ranked player to " .. RankId)
    		    rankUser(Player.UserId, RankId)
    		else
    			print("Player do not own the gamepass")
            end
        end
    end)

I also have RemoteEvents in the Replicated Storage, everything seems to be perfect. But When I test it, nothing happen.
Any help is appreciated!

1 Like

What exactly are you trying to do? What are you trying to accomplish? And what does it currently do that’s unexpected? Gotta have some more info before anyone will be able to assist with the problem.

I’m exactly trying to make the bot automatically rank a person who have the game pass.

If people have the game pass then the text would appear with “YOUR RANK HAS BEEN UPDATED!”, the bot should rank them auto and then remote event will fire the server. After 3 seconds, people will be teleport to main game.

If people do not have game pass then the text would appear with “LOOK LIKE YOU DO NOT OWN THE GAMEPASS!”
then it’ll auto kick them.

Also, I already have set up the bot in glitch project.

Now, when I test it. I clicked the button “Get Rank”.
Loading, then Checking… After that, nothing happens. I was expecting myself to be kicked because I don’t own that game pass, but instead the text appears to be stuck “CHECKING…” not responding after lines 23. How can I solve this?

Delete this also please, delete everything including this topic!

Why? You have to have a reason.

It’s probably bad codes or what, and nobody just help me… I just decided to remove this topic, anyways.

For the future, it’s probably worth leaving it up. Bad or not, it’s a learning experience. You gotta write bad code before you learn to write good code.

1 Like