forgot to mention that this is another script, im trying to make it so if you dont have enough an error will pop up, but if u do have enough a door will open.
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Visible = false
script.Parent.Coin:Play()
if player.leaderstats.intelligence.Value >= 500 then
game.Workspace.moneywall.Transparency = 0.75
game.Workspace.moneywall.CanCollide = false
player.leaderstats.intelligence.Value = player.leaderstats.intelligence.Value - 500
end
end)