|
| 22 Jul 2015 02:06 PM |
| An automatic gun in my game is supposed to do 10 shots in every second. But does about 2-3 instead. When I tried the same gun script in LocalScript the gun shot a lot faster, but I had to switch back to the normal script because the LocalScript DID clone the damage script into the bullets but they didn't even work for some reason. There are tons of loop scripts in my game, there are hundreds of street lamps what turn on at night and off at daylight, basically while wait (1) do scripts. And also cars, the loop checks a condition in every second that if the car health is below 100 then it should blow up and a lot other loops. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 22 Jul 2015 02:50 PM |
yes, they can
when you use loops, make sure they are at least efficient, and you are using wait() wisely
http://blog.roblox.com/2012/05/using-wait-wisely/
also, as for your cars, if the "health" is an intvalue (or numbervalue, etc), use the .Changed event:
http://wiki.roblox.com/index.php?title=API:Class/IntValue/Changed |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2015 03:17 PM |
| if you do a loop you have to use wait() but even wait() uses treads from your cpu and still has to clone the waited seconds to the server. Its best to build 1 loop script for all your street lamps and use the least loops possible. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2015 03:20 PM |
| nope, just the sh itty free model ur using |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2015 03:51 AM |
| Wow, thanks guys (except BothAngles)! It actually worked, I changed tons of waits from 0.1 to larger numbers and also replaced lot of the loops with the .Changed event. Not only the automatic gun is shooting like its supposed to but also the customised character on spawning loads faster, and the doors don't lag anymore! |
|
|
| Report Abuse |
|
|