Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

Here's what I have so far..

function touch(hit)
	hit:remove()
	
end

script.Parent.Touched:connect(touch)

1 comment

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..

2 answers

✓ Accepted answer

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)

1 comment

0

wow I was one super big noob when I wrote this. I am like 10x better now.

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!

4 comments

0

touch is the same thing as OnTouch, I just like to write it this way.

0

:o Well.... in that case. I will upvote your question because you upvoted my question for no reason XD

0

:P

0

:(

This discussion is preserved as it was. New answers, comments, and votes are closed.