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

How do I make it so a block I put a script in will grow?

Asked by 10 years ago

Here's what I have so far..

function touch(hit)
    hit:remove()

end

script.Parent.Touched:connect(touch)
0
and yes I realize this is a script for removing blocks.. I am trying to make a nuke, and I do not want free models.. zachhg03 35 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

I think I can fix this. First thing first, add a click detector in the brick using properties. The script could look like this. The only thing I don't know how to do is make it stop growing. To make it stop growing you need to make the loop false somehow. I just don't know how to make it false. Hope it helps. :D

function grow()
while true do
wait(1) -- you can make it wait as long as you want, e.g wait(1.1)
game.Workspace.Part.Size = game.Workspace.Part.Size + (1,1,1) -- (length, height, width)
end
end
script.Parent.ClickDetector.MouseClick:connect(grow)
0
wow I was one super big noob when I wrote this. I am like 10x better now. raystriker6707 30 — 9y
Ad
Log in to vote
0
Answered by 10 years ago

Well...... I am new to scripting so I can't help you much. All I know is "touch" function is written like that function OnTouch(hit)That's how would line 1 look like.

No..... Don't accept my answer, just upvote it if it helped! Thanks for reading!

0
touch is the same thing as OnTouch, I just like to write it this way. zachhg03 35 — 10y
0
:o Well.... in that case. I will upvote your question because you upvoted my question for no reason XD kudorey619 138 — 10y
0
:P zachhg03 35 — 10y
0
:( kudorey619 138 — 10y

Answer this question