I am making a Cookie Clicker game, and I am trying to make it so if a Player has 100 Cookies, they can buy an Option to get automatic cookies, but I am having troubles on it. The first line has an error, for the "if script.Parent.Parent.Parent.Cookies.Number.Value = 100 then" part. Here is the script:
function onClicked()
if script.Parent.Parent.Parent.Cookies.Number.Value = 100 then
while true do
script.Parent.Parent.Parent.Cookies.Text = script.Parent.Number.Value
script.Parent.Parent.Parent.CPS.Number.Value = script.Parent.Parent.Parent.CPS.Number.Value + 0.3
script.Parent.Parent.Parent.CPS.Text = script.Parent.Parent.Parent.CPS.Number.Value
end
script.Parent.MouseButton1Click:connect(Click)

1 comment
It won't work