#i've tried MANY times to fix this.. please help

1 messages · Page 1 of 1 (latest)

harsh bluff
#

A location with only 2 coordinates?

mellow raptor
#

wait what

harsh bluff
#

?

mellow raptor
#

i dont get it

harsh bluff
mellow raptor
harsh bluff
#

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

mellow raptor
#

ahh

#

i get it

#

thank you sir

raven bay
#

ai moment

mellow raptor
#

🙏

mellow raptor
mellow raptor
#

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

harsh bluff
#

I don't see any teleportation code

mellow raptor
#

wdym?

harsh bluff
mellow raptor
#

whats that mean? and I don't know what you mean by that.

#

i have a bad understanding at english

harsh bluff
#

Show the line of code where you teleport the player

harsh bluff
mellow raptor
#

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

harsh bluff
#

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

mellow raptor
#

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
harsh bluff
#

Just replace x, y, z with {_x}, {_y}, {_z}

harsh bluff
#

Why did you add a random space

harsh bluff
#

There's no space between location and () in my code

mellow raptor
#

oh

mellow raptor
#

um now , can you help me to prevent get tp-ed above water

harsh bluff
#

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