Changing Image in SurfaceGui dependings on leaderstats value

Hello everyone so

  1. What do you want to achieve?
    I have done leaderstats door and I have surfacegui on it and I want to change image inside surfacegui dependings on leaderstats value?
  2. What is the issue? Include screenshots / videos if possible!
    Image isnt changing when player has certain amount of leaderstats value.

Note: SurfaceGui is in StarterGui and its adorneed with the part inside of workspace.

Local script:

local player = game.Players.LocalPlayer
local Image = script.Parent
player.leaderstats.Prestige.Changed:Connect(function()
if player.leaderstats.Prestige.Value >= 5 then
	Image.Image = "rbxassetid://something"
	end
end)

I’m not a good scripter but could the fact it’s a local script be a problem I don’t really know

adding a parameter for the new value of the prestige like dis:


player.leaderstats:WaitForChild("Prestige").Changed:Connect(function(newvalue)
if newvalue >= 5 then
	Image.Image = "rbxassetid://something"
	end
end)

Thank you that was the problem!