What's wrong with my system?

Local Script

local a = script.aValue
local b = script.Cost.Value --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)

It doesn’t change script.Parent.Parent.Lbl.Text into “Bought” or “Not Enough Money”

Not a Programmer, But maybe this?

It probably should be “local b = script.Cost = 1oo”

Instead of:

local b == script.Cost --100

So just change this – to == or one equal idk

1 Like

You can use:

-- Hello!

As a comment, meaning the code wont run.

local a = script.aValue
local b = script.Cost.Value --100

script.Parent.MouseButton1Click:Connect(function()
        if a.Value >= b then
               a.Value = a.Value - b
               script.Parent.Parent.Lbl.Text = "Bought"
               print("Success")
               wait(2.5)
               script.Parent.Parent.Lbl.Text = "$"..b
        else
               script.Parent.Parent.Lbl.Text = "Not Enough Money"
               print("Failure")
               wait(2.5)
               script.Parent.Parent.Lbl.Text = "$"..b
        end
end)

Oh. I just found out why it didn’t work.

oh I thought that was supposed to be a =

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.