#i've tried MANY times to fix this.. please help
1 messages · Page 1 of 1 (latest)
wait what
?
i dont get it
You only have 2 coordinates in your location
sorry , i still dont get it , the part that "i dont get it" is 2 coordinates , you mean x and z right ? i make the y coordinate to set at highest solid block at x z in world Desert..
can you fix it for me?
location x, z in world ""
That location needs 3 coordinates, any location does
You can put any y coordinate, it'll still get the highest block
The y coordinate doesn't matter there but you need to add it
🙏
um sorry for disturbing you again , i want to ask , i alr set it to any y coordinate , and it tp-ed me to the coordinate that i used , not at the highest block , then when i tried with my old code it broke
Show how you tp
if size of {rtp.queue::*} = 2:
# Get a random location within 10,000 blocks in the "Desert" world
set {_x} to random integer between -10000 and 10000
set {_z} to random integer between -10000 and 10000
set {_y} to 90
I don't see any teleportation code
wdym?
.
whats that mean? and I don't know what you mean by that.
i have a bad understanding at english
Show the line of code where you teleport the player
This just sets random integers
oh
Teleport both players to the same location
loop {rtp.queue::*}:
teleport loop-value to location at {_x}, {_y}, {_z} in world "Desert"
send "&aTeleported to a random location in the Desert with your RTP partner!"
this i think
You aren't teleporting to highest block anymore
Why dod you remove that
teleport player above highest block at location(x, y, z, world "Desert")
Just replace x, y and z with the variables
okay ill try
error bro , it says
@harsh bluff
variables:
{rtp.queue::*} = "" # Initializes the queue list
command /rtpq:
trigger:
# Check if the player is already in the queue
if player is in {rtp.queue::*}:
send "&cYou are already in the queue for RTP."
stop
# Add the player to the queue
add player to {rtp.queue::*}
send "&aYou have been added to the RTP queue. Waiting for another player..."
# Check if there are exactly 2 players in the queue
if size of {rtp.queue::*} = 2:
# Get a random location within 10,000 blocks in the "Desert" world
set {_x} to random integer between -10000 and 10000
set {_z} to random integer between -10000 and 10000
set {_y} to 90
# Teleport both players to the same location
loop {rtp.queue::*}:
teleport player above highest block at location ({_x}, {_z}, {_y}, world "Desert")
send "&aTeleported to a random location in the Desert with your RTP partner!"
# Clear the queue
delete {rtp.queue::*}
else:
send "&eWaiting for one more player to join the queue..."
command /rtpqueue:
trigger:
# Check if the queue is empty
set {_queueSize} to size of {rtp.queue::*}
if {_queueSize} = 0:
send "&cThe RTP queue is currently empty."
else:
send "&eCurrent RTP Queue:"
loop {rtp.queue::*}:
send "&7- %loop-value%"
command /rtpqres:
trigger:
# Check if the player is in the queue
if player is in {rtp.queue::*}:
remove player from {rtp.queue::*}
send "&aYou have successfully left the RTP queue."
else:
send "&cYou are not in the RTP queue."
command /rtpqclear:
trigger:
# Clear the queue and notify the player who issued the command
delete {rtp.queue::*}
send "&aThe RTP queue has been cleared."```
here's my full skript
Why did you add the list there
Just replace x, y, z with {_x}, {_y}, {_z}
Why did you add a random space
.
There's no space between location and () in my code
oh
finally it works
um now , can you help me to prevent get tp-ed above water
You can just scratch your whole script and use a pre made function that you can find in the discord server such as this one
options:
ALLOWED_WORLDS: "flat" or "banana"
ALLOWED_BIOMES: a biome
X-POS_MIN: -1000
X-POS_MAX: 1000
Y-POS_MIN: 4
Y-POS_MAX: 100
Z-POS_MIN: -1000
Z-POS_MAX: 1000
function randomTeleport(player: player, tries: number = 10):
if {_player}'s location's world is not {@ALLOWED_WORLDS}:
send "You can't do this here!" to {_player}
else if {_tries} > 0:
set {_x} to random number from {@X-POS_MIN} to {@X-POS_MAX}
set {_z} to random number from {@Z-POS_MIN} to {@Z-POS_MAX}
loop integers from {@Y-POS_MAX} to {@Y-POS_MIN}:
set {_location} to location at {_x}, loop-value, {_z} in {_player}'s location's world
biome at {_location} is {@ALLOWED_BIOMES}
block below {_location} is solid
block at {_location} and block above {_location} are not solid
teleport {_player} to block above {_location}
stop
wait a tick if mod({_tries}, 2) is 0
randomTeleport({_player}, {_tries} - 1)
else:
send "No spot found :(" to {_player}
command /rtp:
trigger:
randomTeleport(player)
Just add your queue system if you want it