Blockland Forums > Modification Help
Deleting all of an object.
Amade:
--- Quote from: Ipquarx on November 23, 2011, 04:36:44 PM ---1. That is not the correct syntax for a for loop.
--- End quote ---
Yes it is, it'll work just fine.
Here's a for loop I've used before:
--- Code: ---for(%currTime = formatDate(getDateTime()); DateGreater(%currTime, $CycleBasis); $CycleBasis = DateAddition($CycleBasis, $CycleLength))
{
$cyclesPassed++;
}
--- End code ---
While you could argue its messiness, it is syntactically correct and does what it's supposed to.
--- Quote from: Ipquarx on November 23, 2011, 04:36:44 PM ---2. The point of a loop is to do something multiple times.
If the object your affecting disappears every time the loop goes, if you try to delete a non-existent object, Blockland will throw it's hands up in dispair and give you a annoying error message saying "no such object!". If you're trying to delete multiple objects, you need to have the code delete a new object every time.
--- End quote ---
Since the loop is using isObject it isn't possible to create an error because the object does not exist.
--- Quote from: Ipquarx on November 23, 2011, 04:36:44 PM ---3. A string is not an object.
It will always return false.
You need to give it an actual object, like a player object or brick, for it to confirm it's an object.
--- End quote ---
If an object is given a name (such as localClientConnection) it can be referenced by its name.
Superb:
Amade beat me to it, ip you should know what you are talking about before trying to teach. :cookieMonster: