script.Parent.MouseButton1Click:Connect(function(plr)
local cost = 300
if plr.leaderstats.Coins.Value > 300 then
if plr.leaderstats.Coins.Value == plr.leaderstats.Coins.Value >= cost then
script.Parent.Text = "Go to the blueprints!"
wait(1)
script.Parent.Parent.Parent.Enabled = false
end
else
script.Parent.Text = "Not enough coins!"
wait(3)
script.Parent.Parent.Parent.Enabled = false
end
end)
This is my script. It might not seem like something is too wrong about it but hear me out.
These two lines are the lines I am having a problem with.
local cost = 300
and
if plr.leaderstats.Coins.Value == plr.leaderstats.Coins.Value >= cost then
So, I've been searching online about Lua metatables. Devforum, scripting helpers, Developer wiki, actual Lua websites, and more. But all the explanations are so confusing. And not many apply to me.
The reason I'm asking about metatables is when I hover over this line:
if plr.leaderstats.Coins.Value == plr.leaderstats.Coins.Value >= cost then
it gives me the following error:
W000: Generic Luau error: Type boolean cannot be compared with >= because it has no metatable
Although, I have not playtested this. So I have no output error to provide. If you wish, I can playtest and add an additional output error.
If anyone can simplify metatables or what I need to do, please do so!

5 comments
I'm not sure why some of it in the middle is in Lua. It's a glitch I get sometimes so bare with me.
This is Luau's type checking in play. You're trying to compare three different things at once, but what's really happening isn't what you think is happening. It is reading them left to right, so it turns one side into a boolean (if it's not == then it turns false, and vice versa) and then compares the boolean with the >= cost. This error is letting you know booleans cant be compared like that.
then how would I fix it?
In your case you can get rid of the first part and the '==' , you're comparing 2 identical things that will always turn out true so there's no point. Change it to: if plr.leaderstats.Coins.Value >= cost then
ty! please post an answer so I can give you rep