This might be a dumb question but how can I say the text 'Not Enough' When the player doesn't have enough levels and not enough cash?
local price = script.Parent.Parent.Price
local level = script.Parent.Parent.Level
local tools = game.ReplicatedStorage:WaitForChild("Tools")
local tool = script.Parent.Parent.ItemName
local player = script.Parent.Parent.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:Connect(function()
if player.Character:FindFirstChild(tool.Value) or player.Backpack:FindFirstChild(tool.value) then
script.Parent.Text = 'Bought'
wait(1)
script.Parent.Text = 'Buy'
return end --Returns if player is holding (or have on the backpack) the tool name (tool.Value)
if player.leaderstats:FindFirstChild("Level").Value >= level.Value then
if player.leaderstats:FindFirstChild("Cash").Value >= price.Value then
player.leaderstats:FindFirstChild("Cash").Value = player.leaderstats:FindFirstChild("Cash").Value - price.Value
game.ReplicatedStorage.ShopBuy:FireServer(tool.Value)
end
end
end)

4 comments
Try changing on line 13+14, .....("Level").Value >= .... Uhm, > is a symbol for below, but... below what? ( Below what level )
Idk if I could put a else since it it has to be equal to or greater than the require level, because if it's below the required level, it need for it to say "Not Enough" and for the cash too.
Is this a local script? Line 5 could be replaced to game.Players.LocalPlayer. Stay away from using so many parents.
Yes it's a local script