So I made a shop button with this local script inside
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
if player.leaderstats.Money >= 200 then
player.leaderstats.Money.Value = player.leaderstats.Money.Value - 200
local item = game.Lighting.Tool
local brought = item:Clone()
brought.Parent = player.Backpack
else script.Parent.Text = "Not enough money"
wait(.5)
script.Parent.Text = "BUY"
end
end)
No error were spotted and if I don't have enough money, the text on the button would stay "BUY" and not "Not enough money". Also if I have enough money it'd stay still. What's the problem here?

4 comments
Local scripts will only run if they're a descendant of the player's character, their backpack, playerGui, playerScripts, or the replicatedfirst service. Is the local script a descendant of any of these?
it's actually I'm comparing userdata with numbers. it's supposed to be Money.Value >= 200. thank you for helping though
Ah. A simple enough mistake. Glad you sorted it out.
You should make the item cloning a remote event btw