Is there a more efficient way to test your game in Roblox Studio

  1. What do you want to achieve? Keep it simple and clear!
    I want to know if I can edit scripts and have it work while I’m testing in like a local server test or team test without having to quit the test and make changes and restart the test.

  2. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I didn’t try any solutions yet and I have looked for solutions on the Dev hub but didn’t see any related questions yet.

You have two testing options (workarounds):

  1. Use the command bar to print outputs, that way you can test if the desired result is being sent by the piece of code you’re doing.
  2. You can edit the script and restart it using Restart/Refresh Script (located on the Script tab). However, I do not recommend it since the code can break even more and it usually doesn’t allow you to restart it unless it has thrown an error.

The best approach is to stop the game and make the desired changes for the script you are looking into. Remember that you can still use the first procedure even if not on test mode, but keep in mind that “offline testing” needs static Instances (so players, characters, etc wouldn’t be available to test unless on testing mode).

1 Like

Seems like you’re trying to hot reload. rewire can help you with that. I won’t go into detail about the library as the link above explains pretty much all you’d need to know about it. Though, for most cases you’d definitely want to stop the game first as @TheRealPrysm had mentioned as to not cause unintended issues,

1 Like

I’d heard a suggestion a few years ago about cutting the script and repasting it back where you cut it from to run it fresh. Not sure if that’s the same as Restart/Refresh as suggested above.
Maybe @TheRealPrysm or @Xxforlife have a reason for or against that.

1 Like

The problem with the Restarting Script is that since it entirely refreshes, some functions that required an event and/or function to be fired might be useless or broken down due to the refresh. (Ex: PlayerAdded event). That’s why (in my opinion), stopping the code and looking for the issues is the best approach for a better testing quality and perfomance.

2 Likes

Thanks man I’ll look in to that