Solved Restart Event

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

CormanYT

Active Member
Jan 6, 2018
122
5
18
So, I have a question. Is there a way that I can do a "restart event" thing? So like, if I have an event say, on script load, and do "restart event" in the middle of it, it stops the event and starts it again. Thanks!
 
Why would you need a restart event?
Restarting isn’t an event it’s a command you execute
 
Why would you need a restart event?
Restarting isn’t an event it’s a command you execute
I'm working a queue system for a minigame, and I want it to restart the "on script load" event. The reason is because it's a lot easier to just restart the event back to the beginning of the queue, then to have to right a lot of code just to make it go back to the start of the queue after the player count drops below 2.
 
Then just do
Execute console command “/sk reload <name of skript here>”
 
Then just do
Execute console command “/sk reload <name of skript here>”
For some reason when I reload a Skript in-game, it causes a seprate instance of the Skript to run alongside the current one, so I have two of the same Skript running using the same queue variables and it's overall messy.
 
That means you’re typing the name of the script incorrectly. It’s case sensitive
 
That means you’re typing the name of the script incorrectly. It’s case sensitive
As if I didn't say, I don't have an issue with reloading itself. I have an issue that when reloading, it's not Shutting down and starting itself up, or starting itself up, and shutting the other instance of itself down.

It's running multiple versions of my same Skript at the same time, so if I reload it, multiple of my same Skript run at the same time.
 
You should put all the code from the on script load event into a function, and run that function whenever you want to restart the event
 
This is solved because I used a method to just skip the part, and didn't have to restart the entire event itself. Solved!
 
To delete those "messy, multiple versions of Skript" that it generated, restart your server.
For the question itself, part of me agrees with ShaneBee and another with TPGamesNL. The reason for that is, I'm not quite sure what you're trying to do here. You're making a queue system, and you need a script load event? I've done many queue systems and I've never needed such event. I've actually never needed it at all. I'm pretty sure what you're trying to do can be done much easily in other ways. Though, if you sometime need to "get to the begginning of an event", you should use functions for that as TPGamesNL said.
Maybe try posting some of your code here?
 
To delete those "messy, multiple versions of Skript" that it generated, restart your server.
For the question itself, part of me agrees with ShaneBee and another with TPGamesNL. The reason for that is, I'm not quite sure what you're trying to do here. You're making a queue system, and you need a script load event? I've done many queue systems and I've never needed such event. I've actually never needed it at all. I'm pretty sure what you're trying to do can be done much easily in other ways. Though, if you sometime need to "get to the begginning of an event", you should use functions for that as TPGamesNL said.
Maybe try posting some of your code here?
I said it's solved??
 
Status
Not open for further replies.