I'm making some basic buying system. But it's not working as it supposed to. When the button is clicked the text doesn't change into "Bought" or "Not Enough Money"
local script:
local a = script.aValue
local b = script.Cost --100
script.Parent.MouseButton1Click:Connect(function()
if a.Value >= b then
a.Value = a.Value - b
script.Parent.Parent.Lbl.Text = "Bought"
print("Success")
script.Parent.Parent.Lbl.Text = b
else
script.Parent.Parent.Lbl.Text = "Not Enough Money"
print("Failure")
script.Parent.Parent.Lbl.Text = b
end
end)

1 comment
Also you might want to add a delay between line 7 and 9 otherwise the text will only change for a very short time... Insert wait(2) between printing success and the next line :)