Need helping fixing my quest skript

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

3dpixelartman

Member
Jun 23, 2021
23
0
1
24
Hi. I need help with my quest skript. It gives no errors in the console but will act like it is completed whenever i right click him even before it starts the quest. My code:
Code:
on right click on zombie:
    if name of event-entity is "Lazy Miner":
        if {queststart::%player%} is false:
            send "&eLazy Miner ----> you: &aHello %player%" to player
            set {queststart::%player%} to true
            wait 0.5 seconds
            send "&eLazy Miner ----> you: &aCan you mine me 5 coal?" to player
            wait 0.5 seconds
            send "&eLazy Miner ----> you: &aI will reward you greatly for a adventurer like you" to player
            wait 0.5 seconds
            send "&eLazy Miner ----> you: &aBut first. Take this" to player
            wait 0.5 seconds
            send "&e&lQUEST STARTED| &r&aMine 5 coal" to player
            give player 1 of unbreakable wooden pickaxe named "&aLazy Miner's pickaxe" with lore "&7breaking power: 1"
            set {questcomp::%player%} to false
        else:
            if {questcomp::%player%} is false:
                if {coalmined::%player%} is not set:
                    send "&cIm sorry but you have 0 coal! You need to mine more" to player
                else:
                    if {coalmined::%player%} is 1:
                        send "&cIm sorry but you have 1 coal! You need to mine more" to player
                    else:
                        if {coalmined::%player%} is 2:
                            send "&cIm sorry but you have 2 coal! You need to mine more" to player
                        else:
                            if {coalmined::%player%} is 3:
                                send "&cIm sorry but you have 3 coal! You need to mine more" to player
                            else:
                                if {coalmined::%player%} is 4:
                                    send "&cIm sorry but you have 4 coal! You need to mine more" to player
                                else:
                                    send "&aThanks! Take these rewards!" to player
                                    add 50 to {miningxp::%player%}
                                    add 50 to {bal::%player%}
                                    set {questcomp::%player%} to true
            else:
                send "&aThanks for your help! It won't be needed anymore" to player

the last line
Code:
send "&aThanks for your help! It won't be needed anymore" to player
is what it will only say every time its right clicked. Can anyone fix it?
 
Hi. I need help with my quest skript. It gives no errors in the console but will act like it is completed whenever i right click him even before it starts the quest. My code:
Code:
on right click on zombie:
    if name of event-entity is "Lazy Miner":
        if {queststart::%player%} is false:
            send "&eLazy Miner ----> you: &aHello %player%" to player
            set {queststart::%player%} to true
            wait 0.5 seconds
            send "&eLazy Miner ----> you: &aCan you mine me 5 coal?" to player
            wait 0.5 seconds
            send "&eLazy Miner ----> you: &aI will reward you greatly for a adventurer like you" to player
            wait 0.5 seconds
            send "&eLazy Miner ----> you: &aBut first. Take this" to player
            wait 0.5 seconds
            send "&e&lQUEST STARTED| &r&aMine 5 coal" to player
            give player 1 of unbreakable wooden pickaxe named "&aLazy Miner's pickaxe" with lore "&7breaking power: 1"
            set {questcomp::%player%} to false
        else:
            if {questcomp::%player%} is false:
                if {coalmined::%player%} is not set:
                    send "&cIm sorry but you have 0 coal! You need to mine more" to player
                else:
                    if {coalmined::%player%} is 1:
                        send "&cIm sorry but you have 1 coal! You need to mine more" to player
                    else:
                        if {coalmined::%player%} is 2:
                            send "&cIm sorry but you have 2 coal! You need to mine more" to player
                        else:
                            if {coalmined::%player%} is 3:
                                send "&cIm sorry but you have 3 coal! You need to mine more" to player
                            else:
                                if {coalmined::%player%} is 4:
                                    send "&cIm sorry but you have 4 coal! You need to mine more" to player
                                else:
                                    send "&aThanks! Take these rewards!" to player
                                    add 50 to {miningxp::%player%}
                                    add 50 to {bal::%player%}
                                    set {questcomp::%player%} to true
            else:
                send "&aThanks for your help! It won't be needed anymore" to player

the last line
Code:
send "&aThanks for your help! It won't be needed anymore" to player
is what it will only say every time its right clicked. Can anyone fix it?
You don't have to do a if for every amount of coal you can just reduce all that to this
Code:
If {coal variable} is not set:
    No coal message
Else if {coal variable} Is less than 5
   Message "You have %{coal variable}% coal."
Else: #when coal variable is more or equal to 5
 Code
 
You don't have to do a if for every amount of coal you can just reduce all that to this
Code:
If {coal variable} is not set:
    No coal message
Else if {coal variable} Is less than 5
   Message "You have %{coal variable}% coal."
Else: #when coal variable is more or equal to 5
 Code
I know that part. I was going to set a custom msg per coal but never got to it. Would that fix the problem with my skript?
 
I know that part. I was going to set a custom msg per coal but never got to it. Would that fix the problem with my skript?
It have to do with the questcomp variable may be is true or just not set. Try defining to false the variable or do a else if instead of if
 
Code:
on right click on zombie:
    if name of event-entity is "Lazy Miner":
        if {queststart::%player%} is false:
            #code here...
            set {questcomp::%player%} to false
        else:
            if {questcomp::%player%} is false:
                #code here
            else:
                send "&aThanks for your help! It won't be needed anymore" to player
This is the issue. On both instances you are checking if {queststart::%player%} is false and never have any place where you set it to a value other than false. Im assuming that you tried to do this instead:
Code:
on right click on zombie:
    if name of event-entity is "Lazy Miner":
        if {queststart::%player%} is not set:
            #code here...
            set {questcomp::%player%} to false
        else:
            if {questcomp::%player%} is false:
                #code here
            else:
                send "&aThanks for your help! It won't be needed anymore" to player
Let me know if this was what you were trying to do or not, and if it works.
 
Status
Not open for further replies.