|
| 02 Jul 2013 01:01 PM |
I need my local scripts to load really fast, and normally from starterpack won't cut it.
what would make them load faster?
and repeat wait(0.03) until game.Players.LocalPlayer.Torso will break the script somehow |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 02 Jul 2013 01:03 PM |
| You can't make them "load" any faster. |
|
|
| Report Abuse |
|
|
| |
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 02 Jul 2013 01:06 PM |
| Thats all down to your coding. There is so magical way to make it run faster. |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 01:41 PM |
someplayer.CharacterAdded:connect(functionhere)?
I have no idea if that will load any faster, though. |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 03:56 PM |
@magnalite. no this is not the coding
its a very simple script with no waits beforehand
but when I spawn, I have to wait a certain amount of time to be able to run the local script from backpack |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 10:55 PM |
| Just do what I said, then... |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 10:59 PM |
"game.Players.LocalPlayer.Torso"
Of course that will break it. Your torso is in your character.
Game.Players.LocalPlayer.Character.Torso |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Jul 2013 11:03 PM |
| That won't break your code. |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 11:06 PM |
| Game.Players.LocalPlayer.Character:WaitForChild("Torso") |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 11:23 PM |
| @Samuel, it does too. sometimes the script just keeps waiting and waiting and never goes |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 11:27 PM |
I haven't done much research on what makes scripts go faster. However, if you're willing to do it yourself, here's a really good way!
local t = tick() -- Your function here print("The function took", tick() - t, "seconds to complete") local t = tick() -- Another version of your function here, but stated in a different way print("The function took", tick() - t, "seconds to complete")
Now choose whichever one took less time to complete.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 11:29 PM |
the function will always take the same amount of time.
the fact that Roblox wont generate the script from the starterpack fast enough is annoying |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 11:34 PM |
I read somewhere that there's ways to make your functions run faster, but I forget the page. I'll try to find it again for you, because if I remember correctly there is, in fact, ways to make your functions run faster. And to answer your "script not starting" fast enough questions:
repeat wait() until game.Players.LocalPlayer.Character repeat wait() until game.Players.LocalPlayer.Character:FindFirstChild("Torso")
That will be fastest overall. Of course, it will only be faster by the teeeeniest bit (as in less than a 50th of a second). But it will be faster. However, if you have an extra 50th of a second on your hand and you want to be more compact, you can do this:
repeat wait() until game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("Torso")
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|