generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: FORMFACTOR DRIVING ME INSANE

Previous Thread :: Next Thread 
DarkheartSkillz is not online. DarkheartSkillz
Joined: 30 Sep 2011
Total Posts: 5125
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 is not online. 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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
22 Oct 2014 10:30 AM
Lol.
Easy fix.

if Part:IsA("FormFactorPart") then
--Do stuff with form factor
end
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
22 Oct 2014 10:32 AM
And ftr, use
if not blah AND not blah.
Don't use Or for that.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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
DarkheartSkillz is not online. DarkheartSkillz
Joined: 30 Sep 2011
Total Posts: 5125
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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image