Author Topic: [Event] Teleport All Players  (Read 3376 times)

Teleport All Players
v3
Simply teleports all of the players in the server to a specific brick!
You can specify a direction with it too!
Note: Only Admins and above can add this event to bricks, but anyone can trigger it.
Also, once players are teleported, they do a teleport effect!
Requested by -Fate-: https://forum.blockland.us/index.php?topic=297275.0
(onWhatever > Self > fetchAll > None North East South West)
(onWhatever > NAMED_BRICK > fetchAll > None North East South West)
This is also the first add-on I've created in about a little over a year. Any help and or criticism is certainly welcomed.
« Last Edit: May 24, 2016, 02:35:31 PM by Cruxeis »

Thank you, I'll need this!


Have you tested this? Looking at the code it doesn't look like it'd work. The last argument(which you didn't include) of registerOutputEvent is appendClient; a boolean of wether to include %client at the end of your function or not.

It'd make more sense to me to make it so that only admins can apply the event, but anyone can trigger it.

It'd be cool if you applied the teleport effect after fetching the players. I think it's %player.doTeleportEffect(); or something like that.

You should add the option to make the player face a certain direction, or keep the direction they had.

Can you make it so it teleports everyone to a named brick instead of just the brick you set the event on?

Can you make it so it teleports everyone to a named brick instead of just the brick you set the event on?
What's wrong with onActivate > NAMED_BRICK > fetchAll?

Have you tested this? Looking at the code it doesn't look like it'd work. The last argument(which you didn't include) of registerOutputEvent is appendClient; a boolean of wether to include %client at the end of your function or not.

It'd make more sense to me to make it so that only admins can apply the event, but anyone can trigger it.

It'd be cool if you applied the teleport effect after fetching the players. I think it's %player.doTeleportEffect(); or something like that.

You should add the option to make the player face a certain direction, or keep the direction they had.
Yes, I tested it and it works. I'll fix the direction and and the effects in a little bit.

Update to v2:
Code: [Select]
Added directions (None North East South West)
Applying the event to a brick is now Admin only, but anyone can trigger the event
Changed appendClient
Players do a teleport effect upon being teleported to the brick

You should probably specify which event they failed to add. Because when someone clicks send on the event dialog, every event is cleared off of the brick and then serverCmdAddEvent is called for every event.

V2 is forgeted up whenever I do <NAMED BRICK> it always resets to (Self) so it literally forgets up the whole server.

Please fix babe I need this

V2 is forgeted up whenever I do <NAMED BRICK> it always resets to (Self) so it literally forgets up the whole server.

Please fix babe I need this
I'll take a look when I get home today, I'll have it done in maybe five hours from now as I'm busy until then.
« Last Edit: May 24, 2016, 02:21:26 PM by Cruxeis »

Update to v3:
Code: [Select]
Fixed <NAMED_BRICK> changing to Self issue
Changed Admin only checks


you can make your code notably more efficient by storing clientGroup.getCount() into a variable, then referencing that variable
clientGroup.getCount() is extremely slow to execute, and while odds are no one will ever notice, it's always a good idea to think about how to make your code more efficient as you become a more proficient programmer.