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 » Game Design
Home Search
 

Re: Lagless Destruction

Previous Thread :: Next Thread 
gavie1234 is not online. gavie1234
Joined: 09 Feb 2011
Total Posts: 177
22 Mar 2015 11:15 AM

I am working on a project that involves making destructible environments. The problem is, when a building blows up, all the parts flying around make the engine lag hard. Is there a script that will automatically delete all loose parts?

Thanks,
gavie1234

(posted earlier, making another post due to lack of replies)
Report Abuse
gavie1234 is not online. gavie1234
Joined: 09 Feb 2011
Total Posts: 177
22 Mar 2015 11:20 AM
bump
Report Abuse
gavie1234 is not online. gavie1234
Joined: 09 Feb 2011
Total Posts: 177
22 Mar 2015 11:26 AM
if only scripting helpers was still up
Report Abuse
championbuilder is not online. championbuilder
Joined: 20 Jan 2009
Total Posts: 13544
22 Mar 2015 11:35 AM
if part.Anchored == false then part:Destroy() end

This what you mean?
Report Abuse
gavie1234 is not online. gavie1234
Joined: 09 Feb 2011
Total Posts: 177
22 Mar 2015 11:54 AM
Kinda.
The problem is, things can only be destroyed if they are unanchored (as far as I am concerned). Pretty much all of the buildings are automatically unanchored by a weld script.
Report Abuse
GodShowsTheWay is not online. GodShowsTheWay
Joined: 27 Oct 2014
Total Posts: 7180
22 Mar 2015 12:27 PM
I don't understand what you want.

Are you asking for all unanchored bricks to be deleted?

Report Abuse
gavie1234 is not online. gavie1234
Joined: 09 Feb 2011
Total Posts: 177
22 Mar 2015 01:20 PM
I want all parts that are flying around to be deleted.

by the way, thanks to everyone helping me
Report Abuse
GodShowsTheWay is not online. GodShowsTheWay
Joined: 27 Oct 2014
Total Posts: 7180
22 Mar 2015 01:26 PM
Check if parts are moving, and then delete them.
Report Abuse
gavie1234 is not online. gavie1234
Joined: 09 Feb 2011
Total Posts: 177
22 Mar 2015 03:17 PM
I'm horrible at scripting, are there any scripts on the developer library for this?
Report Abuse
GodShowsTheWay is not online. GodShowsTheWay
Joined: 27 Oct 2014
Total Posts: 7180
22 Mar 2015 03:37 PM
I can't think of any way to do this without causing massive lag because of loops.
Report Abuse
gavie1234 is not online. gavie1234
Joined: 09 Feb 2011
Total Posts: 177
22 Mar 2015 07:04 PM
Anyone else got any other ideas?
Report Abuse
gavie1234 is not online. gavie1234
Joined: 09 Feb 2011
Total Posts: 177
22 Mar 2015 07:29 PM
bump for halp
Report Abuse
notfruit is not online. notfruit
Joined: 21 Sep 2012
Total Posts: 1386
22 Mar 2015 08:24 PM
You can make the explosion delete all blocks within a certain radius. It's certainly more efficient than iterating through every part and seeing if it moved.
Report Abuse
magicalandre13 is not online. magicalandre13
Joined: 21 Jan 2011
Total Posts: 5327
22 Mar 2015 08:28 PM
Make an invisible "kill" brick.

Make the brick above a certain height, set transparency to 1.

Insert script inside brick.

Insert code to make it so that any bricks(NOT PART OF HUMANOID) will be :Destroy()[ed].
Report Abuse
gavie1234 is not online. gavie1234
Joined: 09 Feb 2011
Total Posts: 177
23 Mar 2015 02:59 PM
@above and @2 above
very good ideas, can someone please make one of these happen? I'm bad with lua.
Report Abuse
ThisUserSecret is not online. ThisUserSecret
Joined: 29 Sep 2012
Total Posts: 1094
23 Mar 2015 04:42 PM
For the invisible brick I would do
Get Brick
Set Brick Transparency to 1
Anchor It

Insert Script

script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
return
end
else hit:remove()
end)

Idk if that would work cause I didn't try it and just typed it here.
Report Abuse
gavie1234 is not online. gavie1234
Joined: 09 Feb 2011
Total Posts: 177
23 Mar 2015 04:57 PM
Thanks for helping! I'll try it!
Report Abuse
GodShowsTheWay is not online. GodShowsTheWay
Joined: 27 Oct 2014
Total Posts: 7180
23 Mar 2015 05:06 PM
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
return
else
hit:Destroy()
end
end)
Report Abuse
gavie1234 is not online. gavie1234
Joined: 09 Feb 2011
Total Posts: 177
23 Mar 2015 05:14 PM
Hm, once I open Studio (im a bit busy now) I'll try this aswell! Thanks!
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
23 Mar 2015 05:59 PM
I'd probably do something like this

game.Workspace.ChildAdded:connect(function(child)
if child:IsA("Explosion") then
child.Hit:connect(function(part)
part.CanCollide = false
game.Debris:AddItem(part, 5)
end)
end
end)

⬡
Report Abuse
gavie1234 is not online. gavie1234
Joined: 09 Feb 2011
Total Posts: 177
24 Mar 2015 04:40 PM
Works awesome! Some of the parts don't disapear, but it's a minor problem that I can deal with! Thanks to everyone who helped me! <3
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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