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)
****Make sure this is in a local script
And if it doesn't work let me know.
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 = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() 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) script.Parent.Text = "BOUGHT" script.Parent.Active = false script.Parent.AutoButtonColor = false script.Parent.Selectable = false end end if player.leaderstats:FindFirstChild("Level").Value <= level.Value then if player.leaderstats:FindFirstChild("Cash").Value <= price.Value then local OlText = ""..script.Parent.Text wait(.6) script.Parent.Text = "NOT ENOUGH CASH" wait(2) script.Parent.Text = OlText end end end)