|
| 22 Oct 2014 10:03 AM |
parts = {"Part","CornerWedgePart","WedgePart","TrussPart","SpawnLocation"}
for a,b in pairs(parts) do p = Instance.new(b,game.Workspace) p.Anchored = true p.Material = "SmoothPlastic" p.Position = Vector3.new(0,0,0) p.BackSurface = "SmoothNoOutlines" p.BottomSurface = "SmoothNoOutlines" p.FrontSurface = "SmoothNoOutlines" p.LeftSurface = "SmoothNoOutlines" p.RightSurface = "SmoothNoOutlines" p.TopSurface = "SmoothNoOutlines" if not p:IsA("CornerWedgePart") or not p:IsA("Truss") then p.FormFactor = "Custom" if p.Name ~= "SpawnLocation" then p.Size = Vector3.new(2,2,2) elseif p.Name == "SpawnLocation" then p.Size = Vector3.new(4,0.2,4) end end end
ERROR: FORMFACTOR IS NOT A VALID MEMBER OF CORNERWEDGEPART I JUST STATED IN THE SCRIPT THAT... AND IT STILL ERRORS
"And how high can you fly with broken wings? " - Aerosmith |
|
|
| Report Abuse |
|
|
Nyxis
|
  |
| Joined: 15 Nov 2012 |
| Total Posts: 3374 |
|
|
| 22 Oct 2014 10:19 AM |
if p:IsA("CornerWedgePart") or p:IsA("Truss") then return end ?
idk |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2014 10:30 AM |
Lol. Easy fix.
if Part:IsA("FormFactorPart") then --Do stuff with form factor end |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2014 10:32 AM |
And ftr, use if not blah AND not blah. Don't use Or for that. |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2014 10:35 AM |
parts = {"Part","CornerWedgePart","WedgePart","TrussPart","SpawnLocation"}
for a,b in pairs(parts) do p = Instance.new(b,game.Workspace) p.Anchored = true p.Material = "SmoothPlastic" p.Position = Vector3.new(0,0,0) p.BackSurface = "SmoothNoOutlines" p.BottomSurface = "SmoothNoOutlines" p.FrontSurface = "SmoothNoOutlines" p.LeftSurface = "SmoothNoOutlines" p.RightSurface = "SmoothNoOutlines" p.TopSurface = "SmoothNoOutlines" if p:IsA("FormFactorPart") then --Added better checking. p.FormFactor = "Custom" end --Took this conditional out of the other one, since I am assuming you want them both to run regardless of the first conditional. if not p:IsA("SpawnLocation") then --Used IsA instead. p.Size = Vector3.new(2,2,2) else --Removed the elseif, since you can just use an "else" and it will be more efficient. p.Size = Vector3.new(4,0.2,4) end end end |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2014 10:56 AM |
Amazing. Where do you get FormFactorPart from??
"And how high can you fly with broken wings? " - Aerosmith |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2014 11:09 AM |
Go to the wiki to any page describing an instance. In the top, it will say the classes it comes from
For example, a Part comes from
Part : FormFactorPart : BasePart : PVInstance : Instance
So if I did IsA("BasePart") then it would return true for every physical part in the game, including game.Workspace.Terrain, since game.Workspace.Terrain also is derived from BasePart.
On the PVInstance page, at the bottom, it lists inherited classes. Model and BasePart are both inherited, so if you wanted to know if something was a BasePart or a Model, do IsA("PVInstance") |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2014 11:12 AM |
Imagine it like a tree.
Instance --PVInstance ----BasePart ------Part ------Wedge ----Model ----Truss
You can see the full tree, if not all of it, here, on the left side: http://wiki.roblox.com/index.php?title=API:Class |
|
|
| Report Abuse |
|
|