Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Buy not working?

Asked by
wackem 50
8 years ago

This buying system for characters doesn't work, apparently

-- Note: 1 = true, 0 = false

local t = script.Parent.Parent.Label
local p = t.Parent.Parent.Parent.Parent.Parent.Parent
local b = script.Parent
local st = p:WaitForChild("AnimsChar").OwnsIntellect
local coins = p:WaitForChild("leaderstats").Coins
local cost = 250

b.MouseButton1Click:connect(function()
    if coins.Value >= cost then
    if st.Value == 0 then
        st.Value = 1
        coins.Value = coins.Value - cost
        print('k')
    end
    end
end)

Errors: none.

Answer this question