Jump to content

[SKRIPT] Speed


AHelpingCandy

Recommended Posts

So I made a script that allowes you to  change speed of another player


SCRIPT: 
command /speed [<number>] [<text>] [<player>]:
    permission: e
    trigger:
        if arg 1 is not set:
            send "Change your speed limits." to player
            send "/speed <speed> [type] [player]" to player
            stop
        if arg 2 is set:
            if arg 2 is "walk":
                if arg 3 is set:
                    if arg 1 is greater than 10:
                        send "&6Set &cwalking &6speed to &c10 &6for %arg 3's prefix%&c%arg 3%&6." to player
                        set arg 3's walking speed to 0.2 * 10
                        stop
                    send "&6Set &cwalking &6speed to &c%arg 1% &6for %arg 3's prefix%&c%arg 3%&6." to player
                    set arg 3's walking speed to 0.2 * arg 1
                    stop
                if arg 1 is greater than 10:
                    send "&6Set &cwalking &6speed to &c10 &6for %player's prefix%&c%player%&6." to player
                    set player's walking speed to 0.2 * 10
                    stop
                set player's walking speed to 0.2 * arg 1
                send "&6Set &cwalking &6speed to &c%arg 1% &6for %player's prefix%&c%player%&6."
                stop
            if arg 2 is "walking":
                if arg 3 is set:
                    if arg 1 is greater than 10:
                        send "&6Set &cwalking &6speed to &c10 &6for %arg 3's prefix%&c%arg 3%&6." to player
                        set arg 3's walking speed to 0.2 * 10
                        stop
                    send "&6Set &cwalking &6speed to &c%arg 1% &6for %arg 3's prefix%&c%arg 3%&6." to player
                    set arg 3's walking speed to 0.2 * arg 1
                    stop
                if arg 1 is greater than 10:
                    send "&6Set &cwalking &6speed to &c10 &6for %player's prefix%&c%player%&6." to player
                    set player's walking speed to 0.2 * 10
                    stop
                set player's walking speed to 0.2 * arg 1
                send "&6Set &cwalking &6speed to &c%arg 1% &6for %player's prefix%&c%player%&6."
                stop
            if arg 2 is "fly":
                if arg 3 is set:
                    if arg 1 is greater than 10:
                        send "&6Set &cflying &6speed to &c10 &6for %arg 3's prefix%&c%arg 3%&6." to player
                        set arg 3's flyingspeed to 0.2 * 10
                        stop
                    send "&6Set &cflying &6speed to &c%arg 1% &6for %arg 3's prefix%&c%arg 3%&6." to player
                    set arg 3's flying speed to 0.1 * arg 1
                    stop
                if arg 1 is greater than 10:
                    send "&6Set &cflying &6speed to &c10 &6for %player's prefix%&c%player%&6." to player
                    set player's flying speed to 0.1 * 10
                    stop
                set player's flying speed to 0.1 * arg 1
                send "&6Set &cflying &6speed to &c%arg 1% &6for %player's prefix%&c%player%&6."
                stop
            if arg 2 is "flying":
                if arg 3 is set:
                    if arg 1 is greater than 10:
                        send "&6Set &cflying &6speed to &c10 &6for %arg 3's prefix%&c%arg 3%&6." to player
                        set arg 3's flyingspeed to 0.2 * 10
                        stop
                    set arg 3's flying speed to 0.1 * arg 1
                    send "&6Set &cflying &6speed to &c%arg 1% &6for %arg 3's prefix%&c%arg 3%&6." to player
                    stop
                if arg 1 is greater than 10:
                    send "&6Set &cflying &6speed to &c10 &6for %player's prefix%&c%player%&6." to player
                    set player's flying speed to 0.1 * 10
                    stop
                set player's flying speed to 0.1 * arg 1
                send "&6Set &cflying &6speed to &c%arg 1% &6for %player's prefix%&c%player%&6."
                stop
        if arg 2 is not set:
            if player is flying:
                if arg 1 is greater than 10:
                    send "&6Set &cflying &6speed to &c10 &6for %player's prefix%&c%player%&6." to player
                    set player's flying speed to 0.1 * 10
                    stop
                set player's flying speed to 0.1 * arg 1
                send "&6Set &cflying &6speed to &c%arg 1% &6for %player's prefix%&c%player%&6." to player
                stop
            if arg 1 is greater than 10:
                send "&6Set &cwalking &6speed to &c10 &6for %player's prefix%&c%player%&6." to player
                set player's walking speed to 0.2 * 10
                stop
            set player's walking speed to 0.2 * arg 1
            send "&6Set &cwalking &6speed to &c%arg 1% &6for %player's prefix%&c%player%&6." to player

Edited by Chloe30k
I made a small mistake
  • Thanks 1
image.png.6b83388bece6fb7d874e120f33c8dd96.png


IGN ➣ Pickey ( Soon ) 
Joined MineHut ➣ January 7th 2019
Joined Forums ➣ January 11th 2021
 
Admin on NotedGens
Manager on NotedGens
Developer on Cropied
Developer on Gennow (Genable)

==========================================
Best Job: Badlion ( Client Moderator [ Failed Trial / Demoted] )
Retired From: InvadedLands ( Moderator )
Retired From:  MineTime ( Sr.Moderator )
Retired From: Hero Mines ( Helper )
Link to comment
Share on other sites

  • 2 weeks later...

This can be compressed and made way smaller. You know you can just do if arg-2 is "fly" or "flying" instead of copying that whole part of the code again and having another if statement. 

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

Will be using that method second time.

image.png.6b83388bece6fb7d874e120f33c8dd96.png


IGN ➣ Pickey ( Soon ) 
Joined MineHut ➣ January 7th 2019
Joined Forums ➣ January 11th 2021
 
Admin on NotedGens
Manager on NotedGens
Developer on Cropied
Developer on Gennow (Genable)

==========================================
Best Job: Badlion ( Client Moderator [ Failed Trial / Demoted] )
Retired From: InvadedLands ( Moderator )
Retired From:  MineTime ( Sr.Moderator )
Retired From: Hero Mines ( Helper )
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...