Victus-Host

create me a script the script should do like its a script for rtp zone when sm1 player enters rtp named region it rtp the player to the selected world (world will be selected in config.yml) placeholder registers %rtp_timer% (This has to be used in fancyholograms to show the players how much is left to rtp The rtp timer should be 30sec Whenever a player enters the rtp region it shows RTPZONE Telepoting in (time left) when the time left it tps the player who is in that region

also the skript color theme is #22FF00

Kodari AI
KodariJun 28 at 7:06 pm 1
RTPZone
A random teleport zone system that automatically teleports players after entering a designated WorldGuard region. Features a 30-second countdown timer with action bar notifications, configurable target world and radius, and a PlaceholderAPI placeholder (%rtp_timer%) for FancyHolograms integration. Players see real-time countdowns and get cancelled notifications if they leave the zone. Color theme: #22FF00 (lime green).

I’ll create the RTP Zone script. One file — self-contained with configurable options at the top.


Setup Instructions:

  1. Place rtpzone.sk in plugins/Skript/scripts/

  2. Create a WorldGuard region named rtp covering your desired zone

  3. Edit the options section at the top of the script to set:

    • rtp-world — the world players teleport to

    • rtp-radius — max distance from 0,0 (e.g. 1000 = ±1000 blocks)

    • rtp-timer — countdown duration (default 30 seconds)

  4. Run /sk reload rtpzone

  5. In FancyHolograms, use {%rtp_timer%} to display the countdown per-player

How it works:

  • Player walks into the rtp region → 30-second countdown starts on action bar

  • Each second the timer ticks down visually

  • At 0 → player teleports to random surface location in the target world

  • Player leaves the region → timer cancels immediately

  • %rtp_timer% placeholder returns 0 when no timer is active, or the remaining seconds

Victus-Host

make that the timer should be activated only no matters player is there or not

Kodari AI
KodariJun 28 at 7:09 pm 1
Victus-Host
1 image attached
Victus-Host

hey

Kodari AI
KodariJun 28 at 7:13 pm 1

Hey! What can I help you with for your Skript?

[Generation stopped]

Kodari AI
KodariJun 28 at 7:15 pm 1

Hey! What can I help you with for your Skript?

Victus-Host
1 image attached
Kodari can make mistakes. Review important code before using.
Files
rtpzone.sk
Code
1 123
rtpzone.sk
# RTP Zone — Global Timer Version
# Color theme: #22FF00 (lime green)
# Placeholder: %rtp_timer% for FancyHolograms
# Teleports all players inside region "rtp" when timer reaches 0
#
# Setup:
#   1. Create a WorldGuard region named "rtp"
#   2. Adjust options below (rtp-world, rtp-radius, rtp-timer)
#   3. /sk reload rtpzone
#   4. In FancyHolograms use {%rtp_timer%}

options:
    # ─── World to teleport players into ───
    rtp-world: world

    # ─── Max random radius from 0,0 (blocks) ───
    rtp-radius: 1000

    # ─── Timer duration in seconds ───
    rtp-timer: 30

    # ─── Display ───
    prefix: &a&lRTPZONE &8» &7

# ─────────────────────────────────────────────
#  GLOBAL TIMER LOOP — runs forever
# ─────────────────────────────────────────────

on script load:
    set {_seconds} to {_rtp-timer} parsed as integer
    if {_seconds} is not set:
        set {_seconds} to {@rtp-timer}
    set {rtp.seconds} to {_seconds}
    set {rtp.timer-active} to true
    broadcast "{@prefix}&fTimer started (&a{@rtp-timer}s&f). Teleporting to &a{@rtp-world}&f."

every 1 second:
    if {rtp.timer-active} is false:
        stop

    # If the global timer hits 0 — teleport everyone in the region
    if {rtp.seconds} is 0:
        loop all players:
            if loop-player is in region "rtp":
                wait 1 tick
                rtpPlayer(loop-player)
        # Reset the timer
        set {rtp.seconds} to {@rtp-timer}
        stop

    # Decrement
    remove 1 from {rtp.seconds}

# ─────────────────────────────────────────────
#  ACTION BAR — shows to anyone in the region
# ─────────────────────────────────────────────

every 1 second:
    loop all players:
        if loop-player is in region "rtp":
            set {_color} to "&a"
            if {rtp.seconds} <= 10:
                set {_color} to "&e"
            if {rtp.seconds} <= 5:
                set {_color} to "&c"
            send action bar "{@prefix}&fTeleporting in {_color}%{rtp.seconds}% &7seconds..." to loop-player

# ─────────────────────────────────────────────
#  PLAYER ENTER — show welcome
# ─────────────────────────────────────────────

on region enter region named "rtp":
    send action bar "{@prefix}&fYou are in the &aRTP Zone&f! Next teleport in &a%{rtp.seconds}% &7seconds..." to player

# ─────────────────────────────────────────────
#  PLAYER LEAVE — notify
# ─────────────────────────────────────────────

on region leave region named "rtp":
    send action bar "{@prefix}&cYou left the RTP Zone." to player

# ─────────────────────────────────────────────
#  TELEPORT FUNCTION
# ─────────────────────────────────────────────

function rtpPlayer(p: player):
    set {_world} to world({@rtp-world})
    if {_world} is not set:
        send "{@prefix}&cWorld '&f{@rtp-world}&c' not found!" to {_p}
        stop

    set {_radius} to {@rtp-radius} parsed as integer
    set {_x} to random integer between -{_radius} and {_radius}
    set {_z} to random integer between -{_radius} and {_radius}
    set {_loc} to location({_x}, 0, {_z}, {_world})

    # Find the surface
    set {_loc} to spawn location of {_loc}'s world above {_loc}
    set {_y} to y-coordinate of {_loc}
    loop 10 times:
        if block at {_loc} is air:
            stop loop
        add 1 to {_y}
        set {_loc} to location({_x}, {_y}, {_z}, {_world})
    loop 10 times:
        if block at {_loc} is not air:
            add 1 to {_y}
            set {_loc} to location({_x}, {_y}, {_z}, {_world})
        else:
            stop loop

    # Teleport
    teleport {_p} to {_loc}
    send "{@prefix}&aTeleported! &7(&f%{_x}%&7, &f%{_z}%&7)" to {_p}

# ─────────────────────────────────────────────
#  PLACEHOLDER — %rtp_timer%
# ─────────────────────────────────────────────

placeholder rtp_timer:
    if {rtp.seconds} is not set:
        return "0"
    return "%{rtp.seconds}%"