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

List of all baseparts?

Asked by 5 years ago

Hello, I was wondering if anyone had a list of all roblox baseparts. I am using https://developer.roblox.com/api-reference/function/Workspace/FindPartsInRegion3 to get all baseparts in a table and storing their info, but I need to know all the types to prepare for future use of the table of properties. https://developer.roblox.com/api-reference/class/BasePart Contains a few but not all. So can anyone give me a list of all baseparts.

0
Or way to detect what type of instance a instance is. benben3963 6 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Here is list of the classes that inherit the BasePart superclass that I know from the top of my head:

  • Part
    • Seat
    • SpawnLocation
  • PartOperation
    • UnionOperation
    • NegateOperation
  • VehicleSeat
  • Terrain
  • TrussPart
  • MeshPart
  • WedgePart
  • CornerWedgePart

(excludes deprecated members, and I will update my post if I find anymore classes)


If I am understanding you correctly, you want to get all the class names of the parts and insert the class names (or the parts?) into the table. I just read your comment and you can check with instance:IsA(className) if a class inherits (or is) of the class className. It returns true if it does, false otherwise. But only parts will be in the table returned by workspace:FindPartsInRegion3(region, instanceToIgnore, maxPartCount), so you do not need this.

BUT, if you want to get the parts of a specific class, you can just check the instance.ClassName property.

```lua local Workspace = game:GetService("Workspace"); local touchingParts = Workspace:FindPartsInRegion3(...); local classNames = {}; --// Table which contains the class names

for _, part in ipairs(touchingParts) do --// Checks and maybe other stuff here table.insert(classNames, part.ClassName); end ```

0
You are god. I didn't know instance.ClassName existed but it will make my life way easier. benben3963 6 — 5y
Ad

Answer this question