I'm trying to make a game with an equipment GUI, and I encountered an error.
My script is below.
script.Parent.MouseButton1Click:Connect(function()
if game.Players.LocalPlayer.leaderstats.Tier.Value >= 5 then
game.Players.LocalPlayer.EquippedTool.Value = tostring(script.Parent.Name)
script.Parent.BorderSizePixel = 5
script.Parent.ZIndex = 2
for i, image in pairs(script.Parent.Parent:GetChildren()) do
if image.Name ~= script.Parent.Name then
image.ZIndex = 1
image.BorderColor3 = Color3.new(0,0,0)
image.BorderSizePixel = 1
end
end
script.Parent.BorderColor3 = Color3.new(255,0,0)
script.Parent.Parent.Parent.TextButton.Text = "Currently Equipped: "..script.Parent.Name
else
script.Parent.Parent.Parent.TextButton.Text = "You need to be at least Tier 5 for this!"
end
end)
It comes out with an error that says "Tier is not a valid member of IntValue"
I have no idea how to fix this.
Thank you!

2 comments
Your hierarchy is wrong.
Also, what you’re doing is the worst thing to do. Seeing your code, it’s a LocalScript. You’re checking the requirements on the client, which only gives the client power.