Solved How would I get a random function out of a list

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

PureNuggets

Member
Jun 25, 2021
17
0
1
16
Code:
function getQuest(p: player):
  if {%{_p}%'s uuid::*} is set:
    send "&cYou already have a ongoing quest! Use /currentquest to view your current quest." to {_p}
  else:
    set {%{_p}'s uuid::*} to random element out of {quests::*}

that is my code, I would like to know how would i set a function to the list {quest::*} and how would i then get that function out of the list randomly and then run it?
 
because im trying to have more quest than 1 and i cant do {quest::%player's uuid%::zombiequest} for example
 
this is an example:
Code:
command /addquest [<text>]:
  trigger:
    add arg-1 to {allquests::*}

command /removequest [<text>]:
  trigger:
    remove arg-1 from {allquests::*}

command /getrandomquest [<text>]:
  trigger:
    set {quest::%player's uuid%::current} to a random element out of {allquests::*}
 
Hey, I marked this thread as solved and marked the best solution! To keep the forum tidy, we ask everyone to mark a solved thread as such (In the upper right corner → "Thread options"), also you can mark the best answer to give the user a small thank you and additionally this will be displayed at the top which helps others to find the best solution directly.
 
Status
Not open for further replies.