complexo
|
  |
| Joined: 07 Jan 2009 |
| Total Posts: 1547 |
|
|
| 10 Jan 2017 08:27 PM |
| I have a way of detecting when a part is at least partially inside an area (such as the area of an explosion). I have a script for making blast holes in blocks based on parameters. What would the best implementation? The most obvious implementation of the part-detection is to ### ## ###### anything that creates an explosion. The most obvious implementation of the blast holes is to put the script for making them in every single damagable block, and have the part-detection call a function inside that script. However, I'm an inexperienced scripter, so perhaps there's a less sloppy solution I don't know of. An additional consideration is that this needs to run locally, so the hole appears instantly; but I have no experience with localscripts. |
|
|
| Report Abuse |
|
|
complexo
|
  |
| Joined: 07 Jan 2009 |
| Total Posts: 1547 |
|
|
| 10 Jan 2017 08:28 PM |
| Apparently Roblox considers "puht iht ihnside" to be too suggestive. |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2017 08:36 PM |
| lmfao community sift is sick dude |
|
|
| Report Abuse |
|
|
complexo
|
  |
| Joined: 07 Jan 2009 |
| Total Posts: 1547 |
|
| |
|
complexo
|
  |
| Joined: 07 Jan 2009 |
| Total Posts: 1547 |
|
|
| 10 Jan 2017 10:06 PM |
Bump I wish OP was easier to read, but the forums decided to ignore my newlines |
|
|
| Report Abuse |
|
|
complexo
|
  |
| Joined: 07 Jan 2009 |
| Total Posts: 1547 |
|
| |
|
complexo
|
  |
| Joined: 07 Jan 2009 |
| Total Posts: 1547 |
|
| |
|
clc02
|
  |
| Joined: 30 Dec 2007 |
| Total Posts: 7393 |
|
|
| 11 Jan 2017 01:14 AM |
| What is it you're actually trying to accomplish? There's some ambiguity. 'Putting holes' as in chopping parts of it off, or just removing it? |
|
|
| Report Abuse |
|
|
complexo
|
  |
| Joined: 07 Jan 2009 |
| Total Posts: 1547 |
|
|
| 11 Jan 2017 01:24 AM |
It's code that makes a crater in a specified block via subdivision and recursive methods. That's not the problem, it's where to put the scripts and how to call the functions. |
|
|
| Report Abuse |
|
|
complexo
|
  |
| Joined: 07 Jan 2009 |
| Total Posts: 1547 |
|
|
| 11 Jan 2017 03:44 AM |
Well, apparently I'm so bad at LUA that I can't figure out how to call a function that's inside another script. It just says the function is not a valid member of Script. |
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 11 Jan 2017 05:25 AM |
Well, you can't call a function from inside another script. Have you looked into module scripts or bindable events/functions?
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx |
|
|
| Report Abuse |
|
|
complexo
|
  |
| Joined: 07 Jan 2009 |
| Total Posts: 1547 |
|
|
| 11 Jan 2017 03:05 PM |
| Nope, and I'd need to understand it well to know what to do exactly, hence me simply asking what the best coding practice for all this is. |
|
|
| Report Abuse |
|
|
complexo
|
  |
| Joined: 07 Jan 2009 |
| Total Posts: 1547 |
|
| |
|
complexo
|
  |
| Joined: 07 Jan 2009 |
| Total Posts: 1547 |
|
|
| 11 Jan 2017 04:05 PM |
Alright, I think I've figured it out.
1) I put the block-damaging script inside an explosion-causing weapon, and inside blocks I have a strength attribute. 2) In the normal script of the explosion-causing weapon, I somehow pass the explosion information to the block-damaging script. 3) The block-damaging script uses the information of the explosion to detect if anything was hit, then for anything that was hit it checks if it has a strength attribute. 4) For every hit block with a strength attribute, it runs the block-damaging script. 5) ????? 6) Profit!
The only step I can't do is 2). |
|
|
| Report Abuse |
|
|