# Randomspawn

Discussion in 'Skript' started by Ter2FIc, Jul 30, 2021.

Thread Status:
Not open for further replies.
1. ### Ter2FIc Member

Joined:
Dec 30, 2020
Messages:
20
Likes Received:
0
Trying to make random spawn, but failed. My worldborder is 1500, 1500~ -1500, 1500
Code (Text):
1. on first join:
2.     set {spawn.%player%} to random number between 1 to 8
3.     if {spawn.%player%} = 1:
4.         teleport player to -217 64 -193
5.         set player's spawnpoint to player's location
6.     if {spawn.%player%} = 2:
7.         teleport player to -132 69 -129
8.         set player's spawnpoint to player's location
9.     if {spawn.%player%} = 3:
10.         teleport player to 302 65 -310
11.         set player's spawnpoint to player's location
12.     if {spawn.%player%} = 4:
13.         teleport player to 498 85 -522
14.         set player's spawnpoint to player's location
15.     if {spawn.%player%} = 5:
16.         teleport player to -1 78 -786
17.         set player's spawnpoint to player's location
18.     if {spawn.%player%} = 6:
19.         teleport player to -271 89 -723
20.         set player's spawnpoint to player's location
21.     if {spawn.%player%} = 7:
22.         teleport player to -516 88 -402
23.         set player's spawnpoint to player's location
24.     if {spawn.%player%} = 8:
25.         teleport player to -895 69 -245
26.         set player's spawnpoint to player's location

#1
2. ### Minecoll_YT SupporterForums Helper

Joined:
Dec 2, 2018
Messages:
650
Likes Received:
39
random number can be: 1.6, 0.5, 4.5, ...
random integer can be: 1, 2, 3, 4, ...

so your solution would be to use random integer instead of random number

#2
Thread Status:
Not open for further replies.

• ### About Us

Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.
• ### Support skUnity

The staff team works very hard to make sure the community is running its best. This means constantly performing upgrades to systems and other features. This does cost a bit of money to keep doing. Donating to skUnity would allow the server to keep running smoothly for years to come!

Support Us!
• ### Join our Discord

Discord is an all-in-one voice and text chat for gamers thatâ€™s free, secure, and works on both your desktop and phone.