Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a projectile unweld objects in a certain radius?

Asked by 6 years ago

So I've made my own rocket launcher from scratch and I have also welded about 1000 little parts together to make one big block. The problem is when I try to remove a weld within the block with a rocket launcher projectile, it unwelds the entire block and so creates this enormous lag, but I want to make it so that there's about a 2 stud radius or so where it destroys these welds, but I don't want the parts to be destroyed either.

Script for the Rocket Launcher and the Block (the code doesn't show well in preview pasted here):

https://pastebin.com/WNTyW63M

Note that my friend made the Block's weld script and the couple of lines of weld code in the rocket launcher since I've yet to learn about welds. He couldn't figure out how to destroy the welds in a radius and I couldn't find helpful information on Google either so I resorted to this website.

Also, if you don't mind, I would love to receive feedback on my scripting as I'm still new to Lua e.g. How I can make the code shorter or tidier or improve it in general.

Thanks for reading.

0
use magnitude caipira 29 — 6y
0
When editing a question, you should see a little blue button that looks like the Lua logo thing, click that and put your code inside of the thingies it creates. theCJarmy7 1293 — 6y

Answer this question