Quests skript not working

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

Potato

Active Member
Feb 24, 2020
57
1
0
17
I made this quests skript and i can't figure out why the variable doesnt work..
The skript stops at where i wrote "THIS IS WHERE IT STOPS"


Code:
Command /Quests:
    trigger:
        if {quest1.%{_p}%} is not set:
            set {quest1.%{_p}%} to 1

        if {currentquest::%player%} is not set:
            set {currentquest::%player%} to 1
            
        if {currentquest::%player%} is 1:
            openQuests(player, "quest1")
            
        if {currentquest::%player%} is 2:
            openQuests(player, "quest2")
        
Function openQuests(p: player, t: string):
    if {_t} is "quest1":
        if {quest1.%{_p}%} is 1:                    #THIS IS WHERE IT STOPS
            send "&cQuest Master: &7Hello mysterious traveler!" to {_p}
            play sound "entity.villager_yes" with volume 10 and pitch 1 at {_p} for {_p}
            set {quest1.%{_p}%} to 2
        else:
            if {quest1.%{_p}%} is 2:
                send "&cQuest Master: &7I actually need your help.." to {_p}
                set {quest1.%{_p}%} to 3
            else:
                if {quest1.%{_p}%} is 3:
                    send "&cQuest Master: &7Can you mine 32 coal ore, and deliver the coal here?" to {_p}
                    set {quest1.%{_p}%} to 4
                else:
                    if {quest1.%{_p}%} is 4:
                        if {quest1active.%{_p}%} is higher than or equal to 32:
                            add 100 to {Tokens::%{_p}%}
                            send "&cQuest Master: &7Thanks for doing that for me!" to {_p}
                            set {quest1.%{_p}%} to 5
                            set {currentquest::%{_p}%} to 2
                        else:
                            send "&cActive Quest: &7Collect 32 coal and deliver them to the Quest Master. &eReward: &7100 Tokens" to {_p}

    if {_t} is "quest2":
        if {quest2.%{_p}%} is not set:
            send "&cQuest Master: &7I actually need more help!" to {_p}
            set {quest2.%{_p}%} to 1
        else:
            if {quest2.%{_p}%} is 1:
                send "&cQuest Master: &7Can you kill 5 players?" to {_p}
                set {quest2.%{_p}%} to 2
            if {quest2.%{_p}%} is 2:
                if {quest2active.%{_p}%} is higher than or equal to 5:
                    #Execute console command "/Crate key %{_p}% vote"
                    set {quest2.%{_p}%} to 4
                    set {currentquest::%{_p}%} to 3
                else:
                    send "&cActive Quest: &7Kill 5 players. &eReward: &7Vote Key" to {_p}
 
On line 4 you used {quest1.%{_p}%} when you were supposed to use {quest1.%player%}
 
Status
Not open for further replies.