Okay, these are some of the words I need help with. (that are not mentioned in scripting glossary)
isA
for __ (mainly the '_' part)
ipairs
inpairs
...
ModuleScript
that's all I have on the top of my head at the moment =)
:IsA
is a method of all instances (ROBLOX objects -- parts, scripts, models, services, etc).
It returns true
if the object is the type of thing you ask for.
Usually, that will just be checking its ClassName
(e.g., a Part has a "Part"
.ClassName
property).
Here's a simple example that checks if something can be assigned a random brick color using :IsA
:
for _, object in pairs(workspace:GetChildren()) do if object:IsA("BasePart") then -- object will have a BrickColor, since it's a part-like-object object.BrickColor = BrickColor.random() end end
ROBLOX organizes the types of objects into a hierarchy -- for instance, WedgeParts, Parts, SpawnLocations, etc, are all BaseParts. You can use :IsA("BasePart")
to detect any type of part (where as :IsA("Part")
or .ClassName == "Part"
detect only Part objects themselves)