ScriptSpot

Forum topic · General Scripting

Noob for loop help!

By Matt_2015 · 2017-03-23

Downloads
Description

Hi,

I'm hoping some one can help... I'm attempting my first max script, so excuse my ignorance!

I would like the script to create a hair that grows from an object... I have achieved this. What I would like to now do is use a for loop so it can repeat that operation with random seeds  I seem to have a problem with the variables.. I've attached a screen grab.. could any one advice on how I should write that part?

many thanks,

Matt

Comments (3)

Matt_2015 · 2017-03-28

.

Error

sable806 · 2017-03-27

Can you provide us the error that it returns.

If i understand correctly you need to loop 5 time and each time assign random values to hair ? I think your error comes from the loop declaration.

Try to replace this :


for i = 1 do *5
(
-- YOUR CODE --
)

with this :


for i = 1 to 5 do
(
-- YOUR CODE --
)

This is a working chunk of code that will loop 5 times before exiting.

Matt_2015 · 2017-03-28

thanks for that...great help :)