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 |
|
|
| |
|
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 |
|
|
|
| 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 |
|
|
|
| 30 Jan 2015 06:36 AM |
| A script is only limited to the power of your CPU... and ROBLOX. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 06 May 2014 |
| Total Posts: 1166 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
| |
|
KAAK82
|
  |
| Joined: 06 May 2014 |
| Total Posts: 1166 |
|
| |
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
|
| 30 Jan 2015 10:44 AM |
| I prefer 1 script that uses modules |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 30 Jan 2015 11:11 AM |
| I meant command cloning so that they already load there... |
|
|
| Report Abuse |
|
|