variable undefined in script:


I'm relatively n00b to MaxScript, today is my 1st look at ScriptSpot. I found a script that I'm very interested in using, but when I run the script, it tells me that the variable 'percent is undefined' per this line:

newLink.pos.controller.percent = (newLink.pos.controller.percent + (100.0/(NumberCopies as float)))

Easy enough error, but being new to MaxScript, I'm not sure how to define 'percent', so I was hoping for a lil' bit of help here to get me going. I've posted the entire script below, which is available at: - for those of you who have not seen the site before.

Thanks in advance,

--The mentioned script--


This script will take ann object that is on a path (using a path controller) and make X copies of it along the spline.


Select the object then run the script. The listener will come up and ask for the number of copies. Enter the number and hit enter.

Author:Paul Hormis
Last Updated: January 23, 2005

v1.00 Created
v2.00 Initial Public Posting

Copyright (C) 2004, 2005 Paul Hormis

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

[email protected]

OCLink = selection as array

OldLink = OCLink[1]


actionMan.executeAction 0 "40472"

NumberCopies = getKBValue prompt:"Enter the number of copies you want:"

for i in 1 to NumberCopies do

NewLink = copy OldLink

newLink.pos.controller.percent = (newLink.pos.controller.percent + (100.0/(NumberCopies as float)))

OldLink = NewLink