Random Potion effect

  • 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.
Apr 7, 2020
2
0
1
23
Title self explanatory, I want the skript to give the player a random potion effect when right clicking. Currently I'm not sure how to accomplish this, This is the code i have so far
Code:
on right click:
   if player is holding a stick named "&f&lCig":
       #Give player random potion effect?

Is there a way I could loop all potion effects and give player a random one, or would there be a simpler solution?
Any would be awesome
 
Code:
on right click:
 if player is holding a stick:
  set {_num} to a random integer between 1 and {maxpotions}
  apply {%{_num}%.potion} 3 to the player
  send "You now have the %{%{_num}%.potion}% effect!" to player

command /potionadd <potion>:
 trigger:
  add 1 to {maxpotions}
  set {_currentpotion} to {maxpotion}
  set {%{_currentpotion}%.potion} to arg-1

I didn't add command permission or anything because I was lazy, and this is the best option that i have came up with. I haven't tested it in game but in the parser it says that it has no errors
 
Status
Not open for further replies.