Jump to content

Pryzmm

Moderator
  • Posts

    1,924
  • Joined

  • Last visited

  • Days Won

    33

Posts posted by Pryzmm

  1. I'm making something like worldedit, but not at the same time. Anyway, for some reason i can't set blocks in a variable. No errors, but it just don't work.

    Part 1 of skript:

    Spoiler

    on script load:
        clear {Setblocks}
        wait 0.25 seconds
        add stone, andesite, and polished_andesite to {Setblocks}

    Part 2 of skript:

    Spoiler

            else if arg-1 is "block":
                if arg-2 is not set:
                    send "&c&lSkymine: &cSet your block (if block is multiple words use _, ex. oak_planks)" to player
                else if arg-2 is set:
                    if {Setblocks} contains arg-2:
                        set {block.%player%} to arg-2
                        send "&c&lSkymine: &cBlock has been set!" to player
                    else:
                        send "&c&lSkymine: &cBlock does not exist. Has it been spelled correctly?" to player

    I am very confused on this. Anyone that can, please help, i appreciate anything i can get.

  2. On 10/19/2020 at 8:05 AM, iro said:

    the skript works and all but when i die in send this error

    "this script "rpg.sk" infinitely (or excessively) repeated itself!" 

    skript:

    on damage of a player:
        {hp.%victim%} isn't 0:
            remove 10 from {hp.%victim%}
            cancel event
        else:
            kill the victim
            set {hp.%victim%} to {maxhp.%victim%}

    Try using Stop like this:
     

    on damage of a player:
        {hp.%victim%} isn't 0:
            remove 10 from {hp.%victim%}
            cancel event
            stop
        else:
            kill the victim
            set {hp.%victim%} to {maxhp.%victim%}
            stop

     

  3. 1 minute ago, _Tarna_ said:

    You are using %player% in an every second and loop all players. There is no player in that event. You need to do %loop-player%. Then that variable will be for that certain loop-player. 

    Also is that variable supposed to be a per person variable? Can't you just set that variable to a player and point it to that player. Like make a command that sets the variable to arg-1, which is player, and point it to that variable's location. 

    Thanks for helping me out and sticking around for one, and two I just can't figure this out. I don't want it to be a command since I want this to be as automatic as possible. I've never really used loop players and i've still got a lot to learn about skript. Sorry if im bothering you with this (if im not, im just socially awkward).

  4. 2 hours ago, _Tarna_ said:

    You could set the variable to the player. Then probably do {MH.hunted}'s location and point it to that. And when the variable is changed to a new person, it will point to them. 

    What does it mean by "Variables can not be used here" or "There's no player in a periodical event"? (sorry i'm not that good at this kind of skripting) Here is my code:

    every 3 seconds in world "manhunt":
        loop all players:
            set the loop player's compass target to location of {MH.hunted%player%}

     

  5. 8 hours ago, Residents said:

    Delete your server through the panel.

    How do I make it so every player is opped when they join the server?

    (i know i already did the previous one but... shush)

    Deop yourself and give away your minehut password

    Why is my server not starting?

  6. This Post has been solved!

    I'm making a manhunt skript and the only thing I have to work on is the compass. I want it to follow a specific person (changes every round) but I don't know how to do that.

    every 3 seconds in world "manhunt":
        set the spawn point of "manhunt" to {MH.hunted} location

     

  7. I'm making a skript rn and it would be really helpful if I could see the arguments



    e.g.

                    |  Help |

                    |  Join  |

                    |Leave |

    /Manhunt   Help

     

    Idk if that made sense or not

  8. I think when i tried to replace (colored text) with (message) it crashed my server @_Tarna_ Here is the whole skript:

    What I Changed Is On The Last Line:

    Spoiler

    options:
        c: {chatcolor.%player%}
        n: {name.%player%}
     
    on join:
        if {chatcolor.%player%} is not set:
            set {chatcolor.%player%} to "&8"
        if {name.%player%} is not set:
            set {name.%player%} to "&7"

    on load:
        set {hex::*} to split "0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f|k|l|m|n|o|r" at "|"
    function rgbToHex(values: numbers) :: string:
        loop {_values::*}:
            set {_r} to "%{_r} ? ""<##""%%{hex::%((loop-value - mod(loop-value, 16)) / 16 + 1)%} ? """"%%{hex::%mod(loop-value, 16) + 1%} ? """"%"
        return colored "%{_r}%>"
    function hslToRgb(h: number, s: number, l: number) :: integers: #
        set {_h} to {_h}/360
        if {_s} = 0:
            set {_r}, {_g} and {_b} to {_l}
        else:
            set {_q} to (({_l} * ({_s} + 1)) if {_l} < 0.5, else ({_l} + {_s} - {_l} * {_s}))
            set {_p} to (2 * {_l}) - {_q}
            set {_r} to hueToRgb({_p}, {_q}, {_h} + 1 / 3)
            set {_g} to hueToRgb({_p}, {_q}, {_h})
            set {_b} to hueToRgb({_p}, {_q}, {_h} - 1 / 3)
        return round(min(255, (255 * {_r}))), round(min(255, (255 * {_g}))) and round(min(255, (255 * {_b})))
    function hueToRgb(p: number, q: number, t: number) :: number:
        add 1 to {_t} if {_t} < 0
        remove 1 from {_t} if {_t} > 1
        return {_p} + ({_q} - {_p}) * 6 * {_t} if {_t} < 1 / 6
        return {_q} if {_t} < 1/2
        return {_p} + ({_q} - {_p}) * (2 / 3 - {_t}) * 6 if {_t} < 2 / 3
        return {_p}
    function gradient(input: string, color-from: integers, color-to: integers) :: string:
        loop {_color-from::*}:
            set {_i::%loop-index%} to round(({_color-to::%loop-index%} - loop-value) / length of {_input})
        loop length of {_input} times:
            if subtext of {_input} from indices loop-number - 1 to loop-number - 1 = "§":
                set {_format} to "%{_format} ? """"%&%subtext of {_input} from indices loop-number to loop-number%" if {hex::*} contains subtext of {_input} from indices loop-number to loop-number
                clear {_format} if subtext of {_input} from indices loop-number to loop-number = "r"
                continue loop
            set {_r} to "%{_r} ? """"%%rgbToHex({_color-from::*})%%{_format} ? """"%%subtext of {_input} from indices loop-number to loop-number%"
            set {_color-from::*} to ({_color-from::1} + {_i::1}), ({_color-from::2} + {_i::2}) and ({_color-from::3} + {_i::3})
        return colored {_r}
    function rainbow(input: string, saturation: number = 1, lightness: number = 0.5) :: string:
        loop (length of {_input}) times:
            if subtext of {_input} from indices loop-number - 1 to loop-number - 1 = "§":
                set {_format} to "%{_format} ? """"%&%subtext of {_input} from indices loop-number to loop-number%" if {hex::*} contains subtext of {_input} from indices loop-number to loop-number
                clear {_format} if subtext of {_input} from indices loop-number to loop-number = "r"
                continue loop
            set {_l} to 360 / (length of {_input})
            set {_r} to "%{_r} ? """"%%rgbToHex(hslToRgb((loop-number * ({_l} if loop-number != 1, else 1)), {_saturation}, {_lightness}))%%{_format} ? """"%%subtext of {_input} from indices loop-number to loop-number%"
        return colored {_r}
    function rainbow2(input: string, saturation: number = 1, lightness: number = 0.5, stretch: number = 5, offset: number = 0) :: string:
        loop (length of {_input}) times:
            # ---- Remove the part below to remove color formatting  
            if subtext of {_input} from indices loop-number - 1 to loop-number - 1 = "§":
                set {_format} to "%{_format} ? """"%&%subtext of {_input} from indices loop-number to loop-number%" if {hex::*} contains subtext of {_input} from indices loop-number to loop-number
                clear {_format} if subtext of {_input} from indices loop-number to loop-number = "r"
                continue loop
            # ---- Remove the part above to remove color formatting  
            set {_l} to loop-number * {_stretch}+{_offset} if loop-number*{_stretch}+{_offset} <= 360, else mod(loop-number*{_stretch}+{_offset}, 360)
            set {_r} to "%{_r} ? """"%%rgbToHex(hslToRgb({_l}, {_saturation}, {_lightness}))%%{_format} ? """"%%subtext of {_input} from indices loop-number to loop-number%"
        return colored {_r}
           
    on chat:
        cancel event
        broadcast "%{name.%player%}%%player's display name%: %{chatcolor.%player%}%%message%"
       
    command /color [<text>]:
        aliases: /c
        permission: Color.Text
        permission message: &8&l[&6&lColor&8&l] &c&lHey! &r&4Sorry but you are not allowed to use this command!
        trigger:
            if arg-1 is not set:
                send "&8&l[&6&lColor&8&l] &6/color &0Black, &1Blue, &2DarkGreen, &3DarkAqua, &4DarkRed, &5DarkPurple, &6Gold, &7Gray, &8DarkGray, &9Blue, &aGreen, &bAqua, &cRed, &dLightPurple, &eYellow, &fWhite, &lBold&r, &oItalic&r, &nUnderline&r, &mStrike&r, &kMagic &r(Magic)" to player
                stop
            set {_check} to "%{@c}%"
            set {@c} to "" if arg-1 is "Clear", "Reset" or "Default"
            set {@c} to "&0" if arg-1 is "Black" or "&0"
            set {@c} to "&1" if arg-1 is "DarkBlue" or "&1"
            set {@c} to "&2" if arg-1 is "DarkGreen" or "&2"
            set {@c} to "&3" if arg-1 is "DarkAqua" or "&3"
            set {@c} to "&4" if arg-1 is "DarkRed" or "&4"
            set {@c} to "&5" if arg-1 is "DarkPurple" or "&5"
            set {@c} to "&6" if arg-1 is "Gold" or "&6"
            set {@c} to "&7" if arg-1 is "Gray" or "&7"
            set {@c} to "&8" if arg-1 is "DarkGray" or "&8"
            set {@c} to "&9" if arg-1 is "Blue" or "&9"
            set {@c} to "&a" if arg-1 is "Green" or "&a"
            set {@c} to "&b" if arg-1 is "Aqua" or "&b"
            set {@c} to "&c" if arg-1 is "Red" or "&c"
            set {@c} to "&d" if arg-1 is "LightPurple" or "&d"
            set {@c} to "&e" if arg-1 is "Yellow" or "&e"
            set {@c} to "&f" if arg-1 is "White" or "&f"
            set {@c} to "%{@c}%&l" if arg-1 is "Bold" or "&b"
            set {@c} to "%{@c}%&o" if arg-1 is "Italics" or "&o"
            set {@c} to "%{@c}%&n" if arg-1 is "Underline" or "&n"
            set {@c} to "%{@c}%&m" if arg-1 is "Strike" or "&m"
            set {@c} to "%{@c}%&k" if arg-1 is "Magic" or "&k"
            replace all "&l" in {@c} with "" if {@c} contains "&l&l"
            replace all "&o" in {@c} with "" if {@c} contains "&o&o"
            replace all "&n" in {@c} with "" if {@c} contains "&n&n"
            replace all "&m" in {@c} with "" if {@c} contains "&m&m"
            replace all "&k" in {@c} with "" if {@c} contains "&k&k"
            send "&8&l[&6&lColor&8&l] &cError. Invalid color!" to player if {_check} is "%{@c}%"

    command /name [<text>]:
        aliases: /n
        trigger:
            if arg-1 is not set:
                send "&8&l[&6&lColor&8&l] &6/name &0Black, &1Blue, &2DarkGreen, &3DarkAqua, &4DarkRed, &5DarkPurple, &6Gold, &7Gray, &8DarkGray, &9Blue, &aGreen, &bAqua, &cRed, &dLightPurple, &eYellow, &fWhite, &lBold&r, &oItalic&r, &nUnderline&r, &mStrike&r, &kMagic &r(Magic)" to player
                stop
            set {_check} to "%{@n}%"
            set {@n} to "" if arg-1 is "Clear", "Reset" or "Default"
            set {@n} to "&0" if arg-1 is "Black" or "&0"
            set {@n} to "&1" if arg-1 is "DarkBlue" or "&1"
            set {@n} to "&2" if arg-1 is "DarkGreen" or "&2"
            set {@n} to "&3" if arg-1 is "DarkAqua" or "&3"
            set {@n} to "&4" if arg-1 is "DarkRed" or "&4"
            set {@n} to "&5" if arg-1 is "DarkPurple" or "&5"
            set {@n} to "&6" if arg-1 is "Gold" or "&6"
            set {@n} to "&7" if arg-1 is "Gray" or "&7"
            set {@n} to "&8" if arg-1 is "DarkGray" or "&8"
            set {@n} to "&9" if arg-1 is "Blue" or "&9"
            set {@n} to "&a" if arg-1 is "Green" or "&a"
            set {@n} to "&b" if arg-1 is "Aqua" or "&b"
            set {@n} to "&c" if arg-1 is "Red" or "&c"
            set {@n} to "&d" if arg-1 is "LightPurple" or "&d"
            set {@n} to "&e" if arg-1 is "Yellow" or "&e"
            set {@n} to "&f" if arg-1 is "White" or "&f"
            set {@n} to "%{@n}%&l" if arg-1 is "Bold" or "&b"
            set {@n} to "%{@n}%&o" if arg-1 is "Italics" or "&o"
            set {@n} to "%{@n}%&n" if arg-1 is "Underline" or "&n"
            set {@n} to "%{@n}%&m" if arg-1 is "Strike" or "&m"
            set {@n} to "%{@n}%&k" if arg-1 is "Magic" or "&k"
            replace all "&l" in {@n} with "" if {@n} contains "&l&l"
            replace all "&o" in {@n} with "" if {@n} contains "&o&o"
            replace all "&n" in {@n} with "" if {@n} contains "&n&n"
            replace all "&m" in {@n} with "" if {@n} contains "&m&m"
            replace all "&k" in {@n} with "" if {@n} contains "&k&k"
            send "&8&l[&6&lColor&8&l] &cError. Invalid color!" to player if {_check} is "%{@n}%"

    command /rbc [<text>]:
        permission: Skript.Rbc
        permission message: &8&l[&6&lColor&8&l] &c&lError: &4You don't have the required permission to perform this command
        trigger:
            if arg-1 is not set:
                send "&8&l[&6&lColor&8&l] &c&lError: &4Please say what you want to say in chat!"
            else if arg-1 is set:
                set {text} to arg-1
                make player say colored rainbow(colored arg-1)

    command /rbctoggle:
        permission: Skript.Rbc
        permission message: &8&l[&6&lColor&8&l] &c&lError: &4You don't have the required permission to perform this command
        trigger:
            if {RBC} is not set:
                set {RBC} to true
                send "&aRainbow Chat Has Been Enabled!"
            else:
                clear {RBC}
                send "&cRainbow Chat Has Been Disabled!"

    on chat:
        if {RBC} is true:
            set {text} to text
            make player say colored rainbow(message)

     

  9. I'm trying to make a command that toggles rainbow chat (i already have the skript) but it wont work. please help.

    The Error:

    The 1st argument given to the function 'rainbow' is not of the required type text. Check the correct order of the arguments and put lists into parentheses if appropriate (e.g. 'give(player,(iron ore and gold ore))'). Please note that storing the value in a variable and then using that variable as parameter will suppress this error, but it still won't work. (Rainbow Chat.sk, line 169: make player say colored rainbow(colored text)')

    The Skript:

    command /rbctoggle:
        permission: Skript.Rbc
        permission message: &8&l[&6&lColor&8&l] &c&lError: &4You don't have the required permission to perform this command
        trigger:
            if {RBC} is not set:
                set {RBC} to true
                send "&aRainbow Chat Has Been Enabled!"
            else:
                clear {RBC}
                send "&cRainbow Chat Has Been Disabled!"
    
    on chat:
        if {RBC} is true:
            set {text} to text
            make player say colored rainbow(colored text)
×
×
  • Create New...