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
 

Re: What would the best coding practice for this be?

Previous Thread :: Next Thread 
complexo is not online. 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 is not online. 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
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
10 Jan 2017 08:36 PM
lmfao community sift is sick dude
Report Abuse
complexo is not online. complexo
Joined: 07 Jan 2009
Total Posts: 1547
10 Jan 2017 09:21 PM
Bump
Report Abuse
complexo is not online. 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 is not online. complexo
Joined: 07 Jan 2009
Total Posts: 1547
10 Jan 2017 11:03 PM
Bump
Report Abuse
complexo is not online. complexo
Joined: 07 Jan 2009
Total Posts: 1547
11 Jan 2017 01:10 AM
Bump
Report Abuse
clc02 is not online. 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 is not online. 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 is not online. 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 is online. 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 is not online. 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 is not online. complexo
Joined: 07 Jan 2009
Total Posts: 1547
11 Jan 2017 03:50 PM
Bump
Report Abuse
complexo is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
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