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: IsA problem

Previous Thread :: Next Thread 
Aerr0w is not online. Aerr0w
Joined: 09 Apr 2009
Total Posts: 565
18 Oct 2013 09:46 AM
for i,r in pairs(script.Parent:GetChildren()) do
if r:IsA("Part") or r:IsA("Seat") or r:IsA("VehicleSeat") or r:IsA("WedgePart") then
wait(5)
r.Anchored = false
end
end

Hello scripters. I've got problem with :IsA. When I add it to my game, it unAnchor's Parts only. Seats, VehicleSeats and Wedges are being Anchored. Do you have any idea how to fix it?
Report Abuse
noah is not online. noah
Joined: 11 Sep 2006
Total Posts: 18977
18 Oct 2013 09:51 AM
Try this:

stuff = {"Part", "Seat", "VehicleSeat", "WedgePart"}
for i,r in pairs (script.Parent:GetChildren()) do
for i,s in pairs (stuff) do
if r.Name == s then
r.Anchored = false
end
end
end
Report Abuse
Aerr0w is not online. Aerr0w
Joined: 09 Apr 2009
Total Posts: 565
18 Oct 2013 10:00 AM
Its still unAnchoring Parts only.
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
18 Oct 2013 10:05 AM
Can't you simply do

if bla:IsA("BasePart") then


?
Report Abuse
spikey490 is not online. spikey490
Joined: 06 Oct 2008
Total Posts: 229
18 Oct 2013 10:06 AM
It should unAnchor all of them, the problem is it waits five seconds for each one before it un-anchors the next part/seat whatever.
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
18 Oct 2013 10:31 AM
Do what zars said, and use BasePart. Using the base classes for IsA is extremely useful.

And to fix your issue, either move the 'wait' outside of that loop, or delete it altogether.
Report Abuse
Aerr0w is not online. Aerr0w
Joined: 09 Apr 2009
Total Posts: 565
18 Oct 2013 11:24 AM
Okay, thank you all. It works properly now!
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