Rank Display wont change when rank changes

I know the current codes waits till the wins value changes but I prefer it like that.

Code:

local OwnerId = script.Parent:WaitForChild("OwnerId")

repeat task.wait() until OwnerId.Value > 0

local plr = game.Players:GetPlayerByUserId(OwnerId.Value)

local PlrWins = plr:WaitForChild("leaderstats"):WaitForChild("Wins")

local PlrRank = plr:WaitForChild("Rank")

repeat task.wait() until PlrRank.Value ~= ""

-- UI Variables

local Holder = script.Parent:WaitForChild("Holder")

local PlrNameDisplay = Holder:WaitForChild("PlrNameDisplay")

local PlrRankDisplay = Holder:WaitForChild("PlrRankDisplay")

local VIPDisplay = Holder:WaitForChild("VIPDisplay")

-- Other Variables

local MPS = game:GetService("MarketplaceService")

local VIPPassId = 000000 -- this is not the correct id this is for sol rng temp gamepass

local RankDatabase = require(game:GetService("ServerStorage"):WaitForChild("RankDatabase"))

local RankGradients = game:GetService("ReplicatedStorage"):WaitForChild("RankGradients")

local NormRankColors = {
	["Beginner"] = Color3.fromRGB(255, 222, 112);
	["Rookie"] = Color3.fromRGB(166, 166, 166);
	["Advanced"] = Color3.fromRGB(255, 56, 86);
};

local function SetRankDisplay()
	
	PlrRankDisplay.Text = PlrRank.Value

	local PlrRankPriority = RankDatabase[PlrRank.Value][3]

	if PlrRankDisplay:FindFirstChildWhichIsA("UIGradient") then PlrRankDisplay:FindFirstChildWhichIsA("UIGradient"):Destroy() end

	if PlrRankPriority >= 4 then -- Rank is Master or higher

		PlrRankDisplay.TextColor3 = Color3.fromRGB(255,255,255)

		local ClonedRankGradient = RankGradients:FindFirstChild(PlrRank.Value):Clone()
		ClonedRankGradient.Parent = PlrRankDisplay

	else

		PlrRankDisplay.TextColor3 = NormRankColors[PlrRank.Value]

	end
	
end

-- Set up player tag

PlrNameDisplay.Text = plr.DisplayName

SetRankDisplay()

PlrWins:GetPropertyChangedSignal("Value"):Connect(function()
	
	SetRankDisplay()
	
end)
  1. why do you call the function twice?

  2. instead of PlrWins:GetPropertyChangedSignal("Value"):Connect(function()
    do:
    PlrWins:GetPropertyChangedSignal("Value"):Connect(SetRankDisplay)

other than that i can’t seem to find an issue, are you sure you’re changing the win value properly whenever the player wins?