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

Help with a Growing Script

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

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
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. newholland1 5 — 10y
0
its because seeder is what is tested to touch it DragonSkyye 517 — 10y
0
Well I have changed everything that would touch the plant to seeder but it still doesn't grow... newholland1 5 — 10y
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" DragonSkyye 517 — 10y
Ad

Answer this question