Quest GUI

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

Quentin_GHG

New Member
Mar 15, 2024
9
0
1
23
Hello lately I tried adding a custom Quest system to my server that gives the player a reward everytime they do this, I wanted this system to reset every day or week whatever, but I just was not able to make it random each quest, (so as an example 2 rows of quest = 18 quest) and all of them random, but not a single one duplicate I dont want the same quest multiple times only once, I just need the system for it to be random but not the same twice, there probably is a simple solution, but I myself couldnt figure it out, thanks for your time, and hopefully a response :emoji_grinning: If I did not explain it very well ask me everything I will try to answer the questions as fast as possible
 
You can add all the different types of quests to a list variable and then select 18 random elements from that variable, add them to today's quest, and then remove them from the variable so they never show up again
 
Thanks for your Idea, the only problem now is, how do I save the Quests? Now I got it on every /resetquests, wich basically just sets the variables to the list, /setquest just adds the item for the GUI, I can automate all of that later, my only question is how do I save these Things effieciently in a variable? or something else. I know this code is messy and all im not that good with that kind of stuff, I tried with an external function but I could not get that to work either lol, thanks for helping already though, its really nice having people like you!
Code:
function quests(p: player):
    set {quests%{_p}%} to a new chest inventory with 3 row named "&bQuests"
    set slot 4 of {quests%{_p}%} to clock named "&bQuests" with lore "&8New quests in: %{battlepasstimer}% Hours."
    open {quests%{_p}%} to {_p}
    if {nothinghereyet} is not set:
        set {_questtaken} to a random element out of {quests::*}
        set slot 9 of {quests%{_p}%} to {_questtaken}
        remove {_questtaken} from {quests::*}
        wait 1 second
        set {_questtaken} to a random element out of {quests::*}
        set slot 10 of {quests%{_p}%} to {_questtaken}
        remove {_questtaken} from {quests::*}
        wait 1 second
        set {_questtaken} to a random element out of {quests::*}
        set slot 11 of {quests%{_p}%} to {_questtaken}
        remove {_questtaken} from {quests::*}
        wait 1 second
        set {_questtaken} to a random element out of {quests::*}
        set slot 12 of {quests%{_p}%} to {_questtaken}
        remove {_questtaken} from {quests::*}
        wait 1 second
        set {_questtaken} to a random element out of {quests::*}
        set slot 13 of {quests%{_p}%} to {_questtaken}
        remove {_questtaken} from {quests::*}
        wait 1 second
        set {_questtaken} to a random element out of {quests::*}
        set slot 14 of {quests%{_p}%} to {_questtaken}
        remove {_questtaken} from {quests::*}
        wait 1 second
        set {_questtaken} to a random element out of {quests::*}
        set slot 15 of {quests%{_p}%} to {_questtaken}
        remove {_questtaken} from {quests::*}
        wait 1 second
        set {_questtaken} to a random element out of {quests::*}
        set slot 16 of {quests%{_p}%} to {_questtaken}
        remove {_questtaken} from {quests::*}
        wait 1 second
        set {_questtaken} to a random element out of {quests::*}
        set slot 17 of {quests%{_p}%} to {_questtaken}
        delete {quests::*}


command /setquests:
    trigger:
        battlepass(player)
        set {questbreakblock} to book named "Quest 1"
        set {questkillplayer} to book named "Quest 2"
        set {questplaytime} to book named "Quest 3"
        set {questcollectxp} to book named "Quest 4"
        set {questwalkdistance} to book named "Quest 5"
        set {questearnmoney} to book named "Quest 6"
        set {questusemana} to book named "Quest 7"
        set {questtradewithvillager} to book named "Quest 8"
        set {questtakedamage} to book named "Quest 9"

command /resetquests:
    trigger:
        add {questbreakblock} to {quests::*}
        add {questkillplayer} to {quests::*}
        add {questplaytime} to {quests::*}
        add {questcollectxp} to {quests::*}
        add {questwalkdistance} to {quests::*}
        add {questearnmoney} to {quests::*}
        add {questusemana} to {quests::*}
        add {questtradewithvillager} to {quests::*}
        add {questtakedamage} to {quests::*}
 
Last edited:
Oh I think I did not day that in the first few messages, im like still learning the skript language, and I never played around with using Json or yml files, thought that was not implemented in skript, but I will sure try it out, I will inform you tomorrow if it worked :emoji_slight_smile:
 
Using the skript-yaml addon for skript, you can create, write info in, pull info from, delete info from, and delete YAML/YML files.