Help with group ranker

I tested this out in my game and I get no output. I also get no errors. It should change the text to failed or ranked

local Player = game.Players.LocalPlayer
local MarketplaceService = game:GetService("MarketplaceService")

function RANK()
	game.ReplicatedStorage.ClaimRank:FireServer()
	script.Parent.Text = "Rank Updated"
	wait(1)
	script.Parent.Text = "Claim Rank"
end

script.Parent.MouseButton1Click:Connect(function()
	if MarketplaceService:UserOwnsGamePassAsync(Player.UserId, 12045812) then
		if Player:GetRankInGroup(4334355) <= 2 then
	     RANK()
		end
	elseif MarketplaceService:UserOwnsGamePassAsync(Player.UserId, 12045809) then
		if Player:GetRankInGroup(4334355) <= 3 then
			RANK()
		elseif MarketplaceService:UserOwnsGamePassAsync(Player.UserId, 12045805) then
			if Player:GetRankInGroup(4334355) <= 4 then
				RANK()
			elseif MarketplaceService:UserOwnsGamePassAsync(Player.UserId, 12045800) then
				if Player:GetRankInGroup(4334355) <= 5 then
					RANK()
				elseif MarketplaceService:UserOwnsGamePassAsync(Player.UserId, 12045785) then
					if Player:GetRankInGroup(4334355) <= 5 then
						RANK()
					else
						script.Parent.Text = "Failed to rank you or you were already reanked"
						wait(1)
						script.Parent.Text = "Check Rank"
					end
				end
			end
		end
	end
end)

could you tell me the problem?

When I click the button nothing happened. I know it is detecting it but I has no output.

and what’s supposed to happen?

It should say ranked or failed to rank if it fails

Did you check the script analysis?

Please be more specific when making a topic, people shouldn’t be having to ask what’s wrong. next time please state the problem, what’s supposed to happen etc. :happy3:

still nothing It says nothing is wrong

You did not initially say when the function would end. A “fixed” way of doing this would be;

function RANK()
	game.ReplicatedStorage.ClaimRank:FireServer()
	script.Parent.Text = "Rank Updated"
	wait(1)
	script.Parent.Text = "Claim Rank"
end
1 Like

sorry I am still new to this but should happen is it should change the text to say failed or ranked

Sorry when I was copying the script I forgot that ops

try reading your script again, and make sure your script make cense.

1 Like

The problem was were the end were and it was going over things 20 times

1 Like

oh well good job finding the problem! you should have some hesitation for posting on devforum

1 Like