Solved Skript crashes sever

  • 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!

20Spaces

Member
Apr 26, 2024
18
3
3
14
I was working on a simple skript of a sever that I own. I was able to create this code:
Code:
on load:
    set {customitems::dashrod} to unbreakable fishing rod named "&1Dash Rod" with lore "&2Right click to dash"
    set {customitems::flyboots} to unbreakable golden boots named "&2Fly Boots" with lore "&1Allow the player to double jump"

command items <text>:
    trigger:
        give player {customitems::%arg-1%}

on left click:
    send "Work clcik" to player
    if player's held item is {customitems::dashrod}:
        send "Work dash" to player
        push player upwards with velocity 2
        play mob spawner flames at player
  
on armor change:
    if boots of player is {customitems::flyboots}:
        while boots of player is {customitems::flyboots}:
            if block under player not gold block:
                set block under player to gold block

However whenever I put the "fly boots" on it crashes the sever I am using. I don't even know if the "if block under player" is working. Please help Thanks!
 
Its probably because of the while loop you have there in the on armor change event. Try adding a wait time.
 
Code:
while boots of player is {customitems::flyboots}:
    if block under player not gold block:
        set block under player to gold block
    wait 0.2 seconds
smth like that
 
Code:
while boots of player is {customitems::flyboots}:
    if block under player not gold block:
        set block under player to gold block
    wait 0.2 seconds
smth like that
Do you know if the "if block under player" is a vailed command? It doesn't seem to be working?
 
Yes, it is but you are missing "is" in your line so it will be if block under player is not gold block: