• Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Norbiros

Member
Oct 24, 2021
1
0
1
Hello, I wrote this code:
Code:
command /rtp:
    description: Teleportuje gracza w losowe miejsce!
    trigger:
        if world is not "world":
            send "&cNie możesz używać tej komendy w &ltym świecie&c!"
        else:
            if difference between {servercore::rtp::%player%} and now < 0 minutes:
                set {_} to difference between {servercore::rtp::%player%} and now
                set {_t} to "%difference between 3 minutes and {_}%"
                send "&cNie możesz użyć tej komendy jeszcze przez &l%formatted({_t})%"
            else:
                if {servercore::rtp-teleport::%player%} is true:
                    send "&cNie możesz użyć tej komendy podczas teleportacji!"
                    stop
                send title "&aLosowa Teleportacja!" with subtitle "&7Zaraz się przeleportujesz!"
                set {_loc::old} to player's location
                set {_time} to now

                while player's location is {_loc::old}:
                    set {_loc::new} to location at random number between 9500 and -9500, 256, random number between 9500 and -9500
                    loop 256 times:
                        if {_loc::new} and block above {_loc::new} are air:
                            if "%block under {_loc::new}%" doesn't contain "air" or "water" or "lava" or "leaves":
                                set {_loc::new} to location of {_loc::new}
                                set {servercore::rtp::%player%} to now
                                stop loop
                        set {_loc::new} to block under {_loc::new}
                    wait 5 ticks
                set {_dif} to difference between {_time} and now
                set {_dif} to difference between 5 seconds and {_dif}
                set {_cdif} to "%{_dif}%"
                set {_t} to timeformat({_cdif})
                send title "&aLosowa Teleportacja!" with subtitle "&7Poczekaj %{_t}%!"
                wait {_dif}
                teleport player to {_loc::new}
                send title "&aLosowa Teleportacja!" with subtitle "&aPomyślnie przelepotowano!"


Sometimes it teleport me fine. But sometimes i have a lot of errors in code [error.txt]
**This is problem with skript? Maybe it is problem without to small ram and world is not pre-generatet**
 

Attachments

  • error.txt
    914.4 KB · Views: 140
Hey,

can't really give you a 100% confident answer but from what I see, I'd assume it is your server version.

"hard-loading" chunks, especially on 1.18.1, tends to be very laggy. By that I mean when you do /rtp, you are dropped straight into a chunk that has never been loaded before, therefore causing lag. You can solve this by setting a border & pre-loading your world.

This was/is a problem on many Survival servers and doesn't have anything to do with Skript.

You can replicate this issue by teleporting to a random location that has never been discovered before. Example: /minecraft:tp WcaleNieNorbiros -95813 100 49185

Hope this helped C:
 
Status
Not open for further replies.