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: Remove all packages (IsA?)

Previous Thread :: Next Thread 
GuestCapone is not online. GuestCapone
Joined: 19 Oct 2012
Total Posts: 1928
03 Jun 2013 09:38 AM
Just trying to make a simple script like below, but never can remember how to do IsA(s).

hum = script.Parent -- Players model
if hum. something Isa "BodyPackage" then
something :Remove()
Report Abuse
shotgreen999 is not online. shotgreen999
Joined: 29 Nov 2009
Total Posts: 376
03 Jun 2013 09:45 AM
You most do it like this:

if game.Workspace.part:IsA("Brick") then
--stuff
end
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
03 Jun 2013 09:49 AM
@shotgreen

"Brick" is not a class name. It's "Part", or "BasePart".
Report Abuse
GuestCapone is not online. GuestCapone
Joined: 19 Oct 2012
Total Posts: 1928
03 Jun 2013 09:58 AM
@Shot,

so for multiple things I would do :

for i, v script.Parent.IsA("Brick") then
v:Remove()
end
Report Abuse
1WOOF1 is not online. 1WOOF1
Joined: 03 May 2009
Total Posts: 20682
03 Jun 2013 09:59 AM
for i,v in pairs(script.Parent:GetChildren()) do
if v:IsA("Part") then
v:Destroy()
end
end
Report Abuse
GuestCapone is not online. GuestCapone
Joined: 19 Oct 2012
Total Posts: 1928
03 Jun 2013 10:00 AM
Ohhhhhhhhh I see, thanks.
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
03 Jun 2013 11:42 AM
I haven't read any answers so sorry if it's already been suggested but here's what I use:

-- REMOVE CHARACTER MESHES
for a,b in pairs(hum:GetChildren()) do
if (b:IsA("CharacterMesh")) then
b:Destroy()
end
end

Simple. ^_^
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