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

How can I make something grow every time you click it?

Asked by 3 years ago
Edited 3 years ago

I have tried to do the following:

tree = script.Parent

script.Parent.ClickDetector.MouseClick:Connect(function()
    tree.Size = Vector3.new(1,2,1)
end)

That would work, if I repeated it like 2000 times which I don't plan on doing, so could anyone tell me how I would do this?

EDIT:

I managed to figure it out myself by doing:

function grow()
    script.Parent.Size = script.Parent.Size + Vector3.new(0.1,0.1,0.1)
end

script.Parent.ClickDetector.MouseClick:connect(grow)
0
Since you've solved it already let me give you a tip: You can do tree.Size += Vector3.new(0.1,0.1,0.1) and it's the same thing as what you did because x += y means x = x + y. This is the same for x *=, x -=, x /=. radiant_Light203 1166 — 3y

Answer this question