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

Help with a Growing Script

Hi,

I am trying to make a brick grow like a crop. When the planter brick hits the plant it will grow a little, wait, grow a little and so on.

This is what I have right now. I don't know where to go from here... Im only beginner that's why.

Also is the Vector the size I want it to grow by??

function onTouched(Hit) 
if Hit.Name == "Seeder" then 

script.Parent.Size = script.Parent.Size + Vector3.new (1, 1, 1)
wait(60)

end 
end 
script.Parent.Touched:connect(onTouched)

I also would like to know if I can grow a model that has 2 bricks in it.

1 answer

yes do Vector3 also your code is a bit wrong for waiting how bout give this a try

	local time_to_wait = 60 -- goes by seconds
	local waiting = false
	function Touched(hit)
		if waiting == false then
			waiting = true
			if hit.Name == "Seeder" then
				script.Parent.Size = script.Parent.Size + Vector3.new(1,1,1)
			end
		end
	end

	while wait(time_to_wait) do
		waiting = false
	end

4 comments

0

Hmm... Seams not to be working. I have the plant that has the script inside of. Then I have a simple car that has a brick in the front named Seeder.

0

its because seeder is what is tested to touch it

0

Well I have changed everything that would touch the plant to seeder but it still doesn't grow...

0

it checks if the thing that hits it has the name Seeder try changing Seeder to the thing that touches it or if Seeder is a model do change hit.Name == "Seeder" to hit.Parent.Name == "Seeder"

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