Help with a Skript.

Status
This thread has been locked.

teac

Feedback score
0
Posts
36
Reactions
31
Resources
0
Hey, I'm really new to skript and have barley learn't the basics. I would appreciate help on my current skript as I'm not quite sure how to give a player a armour piece with a randomized protection level.

Heres my current skript If anyone could help it would be greatly appreciated:
Code:
on script load:
     set {predefined::*} to 1, 2 and 3

command /test3:
     trigger:
          set {_gen} to random number out of {predefined::*}
          send "%{_gen}%"
          make player wear diamond chestplate of protection {_gen}
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Meiza

Restricted
Feedback score
2
Posts
71
Reactions
0
Resources
0
I can easily do this for you! Add me on discord Meiza#2830
 

DiscoverCardOG

Feedback score
1
Posts
28
Reactions
10
Resources
0
Code:
command /random:
    trigger:
        set {_random} to a random integer between 1 and 3
        send "%{_random}%"
        if {_random} is 1:
            set player's chestplate to diamond chestplate of protection 1
        if {_random} is 2:
            set player's chestplate to diamond chestplate of protection 2
        if {_random} is 3:
            set player's chestplate to diamond chestplate of protection 3
There's probably a better way to do this without checking if it's each level but it gave me problems so I just did this.
 

Hassan R.

Hassan#2565
Premium
Feedback score
4
Posts
284
Reactions
77
Resources
0
Code:
command /random:
    trigger:
        set {_random} to a random integer between 1 and 3
        send "%{_random}%"
        if {_random} is 1:
            set player's chestplate to diamond chestplate of protection 1
        if {_random} is 2:
            set player's chestplate to diamond chestplate of protection 2
        if {_random} is 3:
            set player's chestplate to diamond chestplate of protection 3
There's probably a better way to do this without checking if it's each level but it gave me problems so I just did this.

Code:
command /random:
    trigger:
        set {_random} to a random integer between 1 and 4
        set player's chestplate to diamond chestplate of protection {_random}
 
Status
This thread has been locked.
Top