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: Mesh Remover Script

Previous Thread :: Next Thread 
Zdude73 is not online. Zdude73
Joined: 26 Feb 2009
Total Posts: 1162
04 Nov 2012 07:29 AM
Simple script, my tests didn't work. I'm trying to get something that removes all Meshes from a model.
Report Abuse
gerit99 is not online. gerit99
Joined: 21 Jul 2010
Total Posts: 521
04 Nov 2012 07:56 AM
local parts = game.OBJECT:GetChildren()
for i=1,#parts do
if parts[i].ClassName == "SpecialMesh" then
parts[i]:destroy()
end
end

It removes every SpecialMesh in the object.
Report Abuse
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
04 Nov 2012 07:56 AM
c = game.Workspace:GetChildren()
for i = 1, #c do
if c[i]:IsA("Model") then
c[i]:FindFirstChild("Mesh"):Destroy()
end
end
Report Abuse
Monkey727 is not online. Monkey727
Joined: 12 Jan 2009
Total Posts: 969
04 Nov 2012 08:15 AM
@ninja, Don't you mean c[i]:IsA("Part") ?
Report Abuse
Monkey727 is not online. Monkey727
Joined: 12 Jan 2009
Total Posts: 969
04 Nov 2012 08:20 AM
Actually Nvm, But I think you guys are taking him a bit to literal..

c = game.Workspace.Model:GetChildren() -- Find your model
for i=1,#c do
c2 = c[i]:GetChildren()
for o=1,#c do
if c2[o].ClassName == "SpecialMesh" then
c2[o]:Remove()
end
end
end

I think that would work.
Report Abuse
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
04 Nov 2012 08:21 AM
Roblox inserted meshes are automatically named "Mesh".... so if you are going to make an efficient mesh deleter then don't call it by it's ClassName.. and he said he wanted to delete every mesh from models..
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
04 Nov 2012 08:49 AM
function s(o)
for _,v in pairs(o:GetChildren())do
if v:IsA("SpecialMesh")then
v:Destroy()
end
s(v)
end
end

Then call s on whatever object you want to remove meshes from, example:

s(Workspace:FindFirstChild("ninja5566"))
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