Resource icon

Script Spawn Script 2.0

  • 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 comminuty!

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

Neelix_bear updated Spawn Script with a new update entry:

0.0.3 Update, The message update

This update adds the ability to make your own messages instead of the default "Neelix: (error message here)" the default will still be there, but your able to change it

Update Summary:
Customization has been added!

Updates:

Command setspawnerror:
Allows you to set the error message that appears when you run /spawn and there isnt a set spawn
Summary: /spawn error message

Command setcreatespawnmessage:
Sets the message that appears when you create spawn, the confirmation...

Read the rest of this update entry...
 
Hey, I'm not putting this as a review but because Shroob didn't provide any constructive criticism in his, I'll be highlighting some stuff that could have been done better with the script.

#1
The script itself works, but the commands and variables could be better organized. For instance, you could've used list variables like {spawn::location} and {spawn::errormsg} so that all spawn properties would be within the same list variable.

Also, this isn't really a critique but rather personal preference, but I would move all the configuration (i.e. setspawn message, spawn message, error message, etc.) to an options section. There really is little need for these properties to be configured in-game and having them in the script itself would eliminate the need for 3 different commands to set each property.

#2
I would also suggest replacing 0.1 seconds with 1 tick. Not only does this look "cleaner," but as tick is the shortest unit of time you could use in Minecraft, it would actually cut down the wait time in half. 1 second is equivalent to 20 ticks. Similarly, 0.1 seconds would be the same as 2 ticks.

However, there really is no need to wait a tick in your code at all. In the respawn event, you can use the respawn location expression to dictate where the player will respawn. As for the join event, you can teleport the player immediately without the wait.


Overall there really isn't anything wrong with your script, if we're talking solely about the correctness of the code. However, I would argue that teleporting players to spawn upon every single join, rather than just the first, is rather inconvenient. Perhaps you could add an option for the server admin to decide whether they want to enable that feature or not. Alternatively, you could also add a command to teleport the player to their last location before they were teleported to the spawn. The former would probably be easier, as teleporting players to their last location could bring issues of its own