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: 1 Script vs Many Scripts

Previous Thread :: Next Thread 
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
30 Jan 2015 05:54 AM
which would be better to Control 1 thing whether it be a Bullet, an NPC etc...

I'm thinking 1 Script would be better... but wat would all u guys say?
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
30 Jan 2015 06:24 AM
1 script = less lag
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
30 Jan 2015 06:31 AM
yes... but 1 thing bugs me, can 1 Script handle tons of things at the same time? :/ cos I think everything has limitations...
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
30 Jan 2015 06:34 AM
1 script can hold as many lines, functions, while's, as possible, if it doesn't crash anything. but, by using a while, I'd say it can run multiple functions at the same time.
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
30 Jan 2015 06:36 AM
A script is only limited to the power of your CPU... and ROBLOX.
Report Abuse
hawks18305 is not online. hawks18305
Joined: 27 Jun 2009
Total Posts: 135
30 Jan 2015 06:55 AM
It shouldn't make a (noticeable) difference.

All scripts do is run loops, functions and handle events. It shouldn't matter weather it'd be in one or ten.
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
30 Jan 2015 06:58 AM
I guess so
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
30 Jan 2015 07:39 AM
Coroutines also exist for running things side-by-side. It's just like running it another script.
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
30 Jan 2015 08:11 AM
hmmm... pretty strange, I dont think that was mensioned about Coroutines, if am not wrong, the Wiki said that its just for Security Reasons, no more than that :/
I may be wrong, I havent raid about Coroutines in a while now in the Wiki
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
30 Jan 2015 08:31 AM
Coroutines have nothing to do with security?
http://wiki.roblox.com/index.php?title=Function_dump/Coroutine_manipulation
Report Abuse
earthyreuben is not online. earthyreuben
Joined: 17 Jan 2010
Total Posts: 669
30 Jan 2015 08:55 AM
I think lag created by scripts acts more like this:

scripts with specific type of purpose*however many scripts do the same thing=More Lag

More scripts*each with a different purpose and work together*using local scripts effectively to handle some calculations = less lag and easier maintenance.

Other factors that contribute to lag are the amount of parts needed to be loaded to the client, and I think this (not scripts) cause more noticeable lag (unless you have a while true loop with no yield).
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
30 Jan 2015 08:58 AM
well one script would b better, because you know how tons of parts cause lag? it's the same with tons of scripts.
Report Abuse
hawks18305 is not online. hawks18305
Joined: 27 Jun 2009
Total Posts: 135
30 Jan 2015 09:04 AM
@Funki

Not really. Parts are physical objects, they have to have physics AND be rendered. Scripts run in the background and if you're not using them for loops, all they need to do is wait for events or functions to be fired
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
30 Jan 2015 09:11 AM
@KAAK, So basically, to answer your question. It is better to use one script, however your code may become very large and hard to read if used for everything. If your code does become large, you should split things up. Otherwise, one script should be just fine.
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
30 Jan 2015 09:20 AM
thnx guys... I always practicly use 1 Script for 1 Purpose (like for example, weapons)
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
30 Jan 2015 09:20 AM
oh and epic, I got mixed up XD I meant to say, no Security, but kind of like... something to do with errors... I cant remember the Words :/
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
30 Jan 2015 09:24 AM
There shouldn't be any errors when running with it, if you roriginal code works, it will work fine with coroutines.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
30 Jan 2015 09:27 AM
I like to use dynamic assignment.
It's easier to clean up scripts than it is to clean up threads, and if a script is throttled then it's going to ruin everything if I use a central management.
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
30 Jan 2015 09:34 AM
Dynamic Assignment?
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
30 Jan 2015 09:44 AM
lol guys
Report Abuse
parkiet3 is online. parkiet3
Joined: 16 Jul 2011
Total Posts: 832
30 Jan 2015 10:44 AM
I prefer 1 script that uses modules
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
30 Jan 2015 11:02 AM
Use

for _,v next, TABLE do

end

It will save you.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
30 Jan 2015 11:08 AM
Everybody said 1 script. Lemme tell you, they're dead wrong.

Multiple scripts are better. Imagine dealing with multiple parts that all change transparency when touched, but the events disconnect after so much time. I would recommend cloning a script into all of them. I wouldn't be handling with all that in the one.

Imagine how unorganized a game like Murder Mystery, or Mad Paintball, League of ROBLOX, etc. would be all in one script. ModuleScripts and multiple scripts for things like event handling per part and best.

Then you gotta think about handling on the client, LocalScripts have to exist for that. Multiple LocalScripts are usually needed for like guis. Then comes weapons, you need a script for shooting, a script for reload, a script for cursor, etc.

Usually, there's LocalScripts, ModuleScripts, a game script, and Scripts for things like .Touched and stuff.


I hope this was informative :P
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
30 Jan 2015 11:09 AM
lol But if you have thousands of scripts cloned into thousands of parts it would be laggyer than one script that does a simple for loop to manage thousands of parts.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
30 Jan 2015 11:11 AM
I meant command cloning so that they already load there...
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