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 » Scripters
Home Search
 

Script to remove meshes?

Previous Thread :: Next Thread 
Persuas is not online. Persuas
Joined: 20 Jan 2011
Total Posts: 1972
04 Sep 2015 10:26 PM
Can someone help me locate a script to remove all the meshes from a game? I'm working with triangle terrain. The parent is Wedge, and child(which I want to remove) is Mesh.
Report Abuse
Persuas is not online. Persuas
Joined: 20 Jan 2011
Total Posts: 1972
04 Sep 2015 10:40 PM
Pleeeeeeeeease
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
04 Sep 2015 10:41 PM
Iterate through all the children of where you want to clear meshes from
check if there's meshes in them
destroy said meshes
Report Abuse
booing is not online. booing
Joined: 04 May 2009
Total Posts: 6594
04 Sep 2015 10:44 PM
for i = 1, #v do
    if v[i]:IsA("SpecialMesh") then
        v[i]:Remove()
    end
end
Report Abuse
Persuas is not online. Persuas
Joined: 20 Jan 2011
Total Posts: 1972
04 Sep 2015 10:54 PM
Complete noob here; that doesn't seem to be working. I made the script then put it in the workspace and nothing happens. Do I have to do anything? And does the script work when the blocks are in a model? Also, the meshes are called "Mesh" not "SpecialMesh". Is that relevant?
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
04 Sep 2015 11:01 PM
Ok this may work:

function recurse(obj)
for i, v in pairs(obj:GetChildren()) do
if v:IsA("SpecialMesh") then
v:Destroy()
else
recurse(v)
end
end
end
Report Abuse
booing is not online. booing
Joined: 04 May 2009
Total Posts: 6594
04 Sep 2015 11:02 PM
function a(b) for i,v in pairs(b:children()) do if not string.find(v.ClassName, "Mesh") then pcall(function() v:Destroy() end) end a(v) end end a(workspace)

Oops my bad bro wrong code.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
04 Sep 2015 11:08 PM
iterate [2]
Report Abuse
Persuas is not online. Persuas
Joined: 20 Jan 2011
Total Posts: 1972
04 Sep 2015 11:33 PM
Can't get any of these to work:\ What is iterate?
Report Abuse
Persuas is not online. Persuas
Joined: 20 Jan 2011
Total Posts: 1972
04 Sep 2015 11:47 PM
Booing, when I insert your code into the command bar it deletes everything in the game.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
04 Sep 2015 11:47 PM
Booing trolled you..
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
04 Sep 2015 11:48 PM
No duh
Report Abuse
Persuas is not online. Persuas
Joined: 20 Jan 2011
Total Posts: 1972
04 Sep 2015 11:50 PM
Well, does anyone have an actual code? xD
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
04 Sep 2015 11:52 PM
What kind of meshes again? Name them EXACTLY case sensitive
Report Abuse
Persuas is not online. Persuas
Joined: 20 Jan 2011
Total Posts: 1972
04 Sep 2015 11:53 PM
Workspace
Model
Wedge
Mesh
Report Abuse
Persuas is not online. Persuas
Joined: 20 Jan 2011
Total Posts: 1972
04 Sep 2015 11:53 PM
Class name is mesh. Not sure if that makes a difference.
Report Abuse
Persuas is not online. Persuas
Joined: 20 Jan 2011
Total Posts: 1972
04 Sep 2015 11:54 PM
SpecialMesh*
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
04 Sep 2015 11:55 PM
Ok so all of these are in a model named Model? If so then that is a reason why my old script failed.
Report Abuse
Persuas is not online. Persuas
Joined: 20 Jan 2011
Total Posts: 1972
04 Sep 2015 11:56 PM
Yes, everything in the game except the base plate is in a model. I can ungroup it but it will take a while considering it's 7500 blocks.
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
04 Sep 2015 11:57 PM
Don't ungroup
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
05 Sep 2015 12:00 AM
here just fill this script in

meshVirus = "SpecialMesh"
mesh = game:FindFirstChild(meshVirus, true)

while mesh do
mesh:Destroy()
end
Report Abuse
Persuas is not online. Persuas
Joined: 20 Jan 2011
Total Posts: 1972
05 Sep 2015 12:02 AM
Fill in where?
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
05 Sep 2015 12:03 AM
Anywhere
Report Abuse
Persuas is not online. Persuas
Joined: 20 Jan 2011
Total Posts: 1972
05 Sep 2015 12:04 AM
Still not working:\

I insertobject a script into the workspace, then copy the text into the script, then cut and paste the script back into the workspace and nothing happens.
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
05 Sep 2015 12:07 AM
Maybe I forgot this?

Ok copy paste that

meshVirus = "SpecialMesh"
mesh = game:FindFirstChild(meshVirus, true)

while mesh do
mesh:Destroy()
mesh = game:FindFirstChild(meshVirus, true)
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 2Go to page: [1], 2 Next
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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