Purchase Frame not working, called unknown

  1. What do you want to achieve? Keep it simple and clear!

I want to make it so when purchase frame opens, if you click yes and you have enough money, it will give you item for that purchase and if not have enough money, it will not give you item.

  1. What is the issue? Include screenshots / videos if possible!

I scripted it but it doesn’t work because the currency itself get called unknown for some reason

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I did try asking people on Hidden Dev, didn’t help. Looked on devforum for solutions, didn’t help either.


if cheez >= 3000 then 
    gui = script.Parent.CantAfford
    local debounce = true
    function onClick(click)
        debounce = false
        local gui = gui:Clone()
        gui.Parent = click.PlayerGui
    end
    script.Parent.ClickDetector.MouseClick:connect(onClick)

end

We need the full script or else we can’t help

1 Like

Yes, please supply your console error and full script. It says it’s not defined.

Make sure you’re defining Chez at the start of your script for it to work.