How to teleport players in a random section of a region?

How to teleport players in a random section of a region?

Postby KrulYuno » 3 January 2020, 12:46

For example, I have a region that is that big. I want players, when they are teleported, being randomly placed on that region. Not on the center. I want them any where on the points of that region.

Also, that region is always moving.

I somewhat can't figure it out with the variables. I can try making random on the variables but i can't apply it.

KrulYuno
 
Posts: 3
Joined: 10 April 2018, 15:56

Re: How to teleport players in a random section of a region?

Postby Silk1 » 3 January 2020, 17:26

There's a trigger that can moves region to another region.
Maybe that could help you.
woo wee wee woo
User avatar
Silk1
Android T-01187 [200]
 
Posts: 215
Joined: 20 November 2019, 13:19

Re: How to teleport players in a random section of a region?

Postby KrulYuno » 4 January 2020, 05:04

Silk1 wrote:There's a trigger that can moves region to another region.
Maybe that could help you.

but won't that region being moved to another region on the center?

KrulYuno
 
Posts: 3
Joined: 10 April 2018, 15:56

Re: How to teleport players in a random section of a region?

Postby jeje52 » 5 January 2020, 18:43

You need to set 2 variables to a random integer between 0 and the region's width/height. Add the region's X/Y coordinates to the variables, and you should end up with X and Y coordinates that are in a random point inside the region. The rest is just moving a region to the coordinates and teleporting the player.
User avatar
jeje52
Civil Security Lite [100]
 
Posts: 146
Joined: 13 April 2018, 19:52


Return to Bug Reporting Archive

Who is online

Users browsing this forum: No registered users



cron