Solved Everything works but the actually quest part

  • 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
So I made a quest system for a server I skript on, I went to test it out on my server with a boosted chance to get the zombie quest so i can test if the quest will work. I killed 50 zombies as my quest says to do and didnt get no message. No skript errors either. I even added a thing where itll tell me everytime i killed a zombie and it still didnt work. Heres my code

Code:
function breadQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eCraft 48 Bread" to {_p}
  set {%{_p}%'s uuid::48breadQuest} to 0

function sugarQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eCraft 2 Stacks Of Sugar" to {_p}
  set {%{_p}%'s uuid::128sugarQuest} to 0
 
function fish30Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eFish 30 Items" to {_p}
  set {%{_p}%'s uuid::fish30Quest} to 0

function fish25Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eFish 25 Items" to {_p}
  set {%{_p}%'s uuid::fish25Quest} to 0

function walk1500Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eWalk 1500 Blocks" to {_p}
  set {%{_p}%'s uuid::walk1500Quest} to 0

function walk1000Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eWalk 1000 Blocks" to {_p}
  set {%{_p}%'s uuid::walk1000Quest} to 0

function place200Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&ePlace 200 Blocks" to {_p}
  set {%{_p}%'s uuid::place200Quest} to 0

function place150Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&ePlace 150 Blocks" to {_p}
  set {%{_p}%'s uuid::place150Quest} to 0

function break200Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eBreak 200 Blocks" to {_p}
  set {%{_p}%'s uuid::break200Quest} to 0

function break150Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eBreak 150 Blocks" to {_p}
  set {%{_p}%'s uuid::break150Quest} to 0

function endermanQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eKill 40 Zombies" to {_p}
  set {%{_p}%'s uuid::endermanQuest} to 0

function spiderQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eKill 50 Spiders" to {_p}
  set {%{_p}%'s uuid::spiderQuest} to 0

function creeperQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eKill 50 Creepers" to {_p}
  set {%{_p}%'s uuid::creeperQuest} to 0

function skeletonQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eKill 50 Skeletons" to {_p}
  set {%{_p}%'s uuid::skeletonQuest} to 0

function zombieQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eKill 50 Zombies" to {_p}
  set {%{_p}%'s uuid::zombieQuest} to 0
 

function loadQuests():
  loop all offline players:
    delete {%loop-offlineplayer%'s uuid::*}
  broadcast "&eQuests By &e&lPureNuggets!"

 

function getQuest(p: player):
  if {%{_p}%'s uuid::*} is set:
    send "&cYou already have a ongoing quest!" to {_p}
  else:
    send "" to {_p}
    send "&eRolling you a random quest!" to {_p}
    send "" to {_p}
    wait 3 seconds
    chance of 5%: #Kill 50 Zombies
      zombieQuest({_p})
    chance of 5%:
      skeletonQuest({_p})
    chance of 5%:
      creeperQuest({_p})
    chance of 5%:
      spiderQuest({_p})
    chance of 5%:
      endermanQuest({_p})
    chance of 5%:
      break150Quest({_p})
    chance of 5%:
      break200Quest({_p})
    chance of 5%:
      place150Quest({_p})
    chance of 5%:
      place200Quest({_p})
    chance of 5%:
      walk1000Quest({_p})
    chance of 5%:
      walk1500Quest({_p})
    chance of 5%:
      fish25Quest({_p})
    chance of 5%:
      fish30Quest({_p})
    chance of 5%:
      sugarQuest({_p})
    chance of 5%:
      breadQuest({_p})

command /quest:
  cooldown: 1 day
  trigger:
    getQuest(player)
    
command /loadquests:
  permission: quests.load
  trigger:
    loadQuests()
    
on load:
  loadQuests()
    
on death:
  if victim is zombie:
    if {%attacker%'s uuid::zombieQuest} is set:
      add 1 to {%attacker%'s uuid::zombieQuest}
      if {%attacker%'s uuid::zombieQuest} > 49:
        send "&eYou have completed the following quest:"
        send ""
        send "&eKill 50 Zombies"
 
Its because theres no actual code adding to your variables that you've made.
 
it might be because your variables are wrong, Try:
Code:
 {%attacker's uuid%::zombiequest}
i already fixed it, it was because i was setting the variables to 0 thinking that would count them as set. heres my fixed one
Code:
function tokenReward(p: player):
  chance of 50%:
    send "&eYou have completed a quest and have gotten 1 Quest Token"
    give player sunflower named "&eQuest Token" with lore "&bUse This Token To Redeem Rewards"
  chance of 35%:
    send "&eYou have completed a quest and have gotten 2 Quest Tokens"
    give player 2 sunflower named "&eQuest Token" with lore "&bUse This Token To Redeem Rewards"
  chance of 15%:
    send "&eYou have completed a quest and have gotten 3 Quest Tokens"
    give player 3 sunflower named "&eQuest Token" with lore "&bUse This Token To Redeem Rewards"

function play1hQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&ePlay for 1 hour" to {_p}
  set {quests::%{_p}%'s uuid::play1hQuest} to 1

function play45Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&ePlay for 45 minutes" to {_p}
  set {quests::%{_p}%'s uuid::play45Quest} to 1

function play30Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&ePlay for 30 minutes" to {_p}
  set {quests::%{_p}%'s uuid::play30Quest} to 1

function 256cobbleQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eMine 256 Cobblestone" to {_p}
  set {quests::%{_p}%'s uuid::breadQuest} to 1

function 192cobbleQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eMine 192 Cobblestone" to {_p}
  set {quests::%{_p}%'s uuid::192cobbleQuest} to 1

function breadQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eCraft 48 Bread" to {_p}
  set {quests::%{_p}%'s uuid::breadQuest} to 1

function sugarQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eCraft 2 Stacks Of Sugar" to {_p}
  set {quests::%{_p}%'s uuid::sugarQuest} to 1
 
function fish30Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eFish 30 Items" to {_p}
  set {quests::%{_p}%'s uuid::fish30Quest} to 1

function fish25Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eFish 25 Items" to {_p}
  set {quests::%{_p}%'s uuid::fish25Quest} to 1

function walk1500Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eWalk 1500 Blocks" to {_p}
  set {quests::%{_p}%'s uuid::walk1500Quest} to 1

function walk1000Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eWalk 1000 Blocks" to {_p}
  set {quests::%{_p}%'s uuid::walk1kQuest} to 1

function place200Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&ePlace 200 Blocks" to {_p}
  set {quests::%{_p}%'s uuid::place200Quest} to 1

function place150Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&ePlace 150 Blocks" to {_p}
  set {quests::%{_p}%'s uuid::place150Quest} to 1

function break200Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eBreak 200 Blocks" to {_p}
  set {quests::%{_p}%'s uuid::break200Quest} to 1

function break150Quest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eBreak 150 Blocks" to {_p}
  set {quests::%{_p}%'s uuid::break150Quest} to 1

function endermanQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eKill 40 Zombies" to {_p}
  set {quests::%{_p}%'s uuid::endermanQuest} to 1

function spiderQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eKill 50 Spiders" to {_p}
  set {quests::%{_p}%'s uuid::spiderQuest} to 1

function creeperQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eKill 50 Creepers" to {_p}
  set {quests::%{_p}%'s uuid::creeperQuest} to 1

function skeletonQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eKill 50 Skeletons" to {_p}
  set {quests::%{_p}%'s uuid::skeletonQuest} to 1

function zombieQuest(p: player):
  send "&eYou have gotten the quest:" to {_p}
  wait 1 second
  send "" to {_p}
  send "&eKill 50 Zombies" to {_p}
  set {quests::%{_p}%'s uuid::zombieQuest} to 1
 

function loadQuests():
  loop all offline players:
    delete {quests::%loop-offlineplayer%'s uuid::*}
  broadcast "&eQuests By &e&lPureNuggets!"

 

function getQuest(p: player):
  if {quests::%{_p}%'s uuid::*} is set:
    send "&cYou already have a ongoing quest!" to {_p}
  else:
    send "" to {_p}
    send "&eRolling you a random quest!" to {_p}
    send "" to {_p}
    wait 3 seconds
    chance of 5%: #Kill 50 Zombies
      zombieQuest({_p})
    chance of 5%: #Kill 50 Skeletons
      skeletonQuest({_p})
    chance of 5%: #Kill 50 Creepers
      creeperQuest({_p})
    chance of 5%: #Kill 50 Spiders
      spiderQuest({_p})
    chance of 5%: #Kill 40 Endermen
      endermanQuest({_p})
    chance of 5%: #Break 150 Blocks
      break150Quest({_p})
    chance of 5%: #Break 200 Blocks
      break200Quest({_p})
    chance of 5%: #Place 150 Blocks
      place150Quest({_p})
    chance of 5%: #Place 200 Blocks
      place200Quest({_p})
    chance of 5%: #Walk 1k Blocks
      walk1000Quest({_p})
    chance of 5%: #Walk 1.5k Blocks
      walk1500Quest({_p})
    chance of 5%: #Fish 25 Items
      fish25Quest({_p})
    chance of 5%: #Fish 30 Items
      fish30Quest({_p})
    chance of 5%: #Craft 128 Sugar
      sugarQuest({_p})
    chance of 5%: #Craft 48 Bread
      breadQuest({_p})
    chance of 5%: #Break 192 Cobble
      192cobbleQuest({_p})
    chance of 5%: #Break 256 Cobble
      256cobbleQuest({_p})
    chance of 5%: #Play For 30 Minutes
      play30Quest({_p})
    chance of 5%: #Play For 45 Minutes
      play45Quest({_p})
    chance of 5%: #Play For 1 Hour
      play1hQuest({_p})
      

command /quest:
  cooldown: 1 day
  trigger:
    getQuest(player)
    
command /loadquests:
  permission: quests.load
  trigger:
    loadQuests()
    
on load:
  loadQuests()
    
on death:
  if victim is zombie:
    if {quests::%attacker%'s uuid::zombieQuest} is set:
      add 1 to {quests::%attacker%'s uuid::zombieQuest}
      send "&eYou have killed %{quest::%attacker%'s uuid::zombieQuest} - 1%&e/50 Zombies!" to attacker
      if {quests::%attacker%'s uuid::zombieQuest} > 50:
        send "&eYou have completed the following quest:" to attacker
        send "" to attacker
        send "&eKill 50 Zombies" to attacker
        delete {quests::%attacker%'s uuid::zombieQuest}
        tokenReward(attacker)
  if victim is skeleton:
    if {quests::%attacker%'s uuid::skeletonQuest} is set:
      add 1 to {quests::%attacker%'s uuid::skeletonQuest}
      send "&eYou have killed %{quest::%attacker%'s uuid::skeletonQuest} - 1%&e/50 Skeletons!" to attacker
      if {quests::%attacker%'s uuid::skeletonQuest} > 50:
        send "&eYou have completed the following quest:" to attacker
        send "" to attacker
        send "&eKill 50 Skeletons" to attacker
        delete {quests::%attacker%'s uuid::skeletonQuest}
        tokenReward(attacker)
  if victim is creeper:
    if {quests::%attacker%'s uuid::creeperQuest} is set:
      add 1 to {quests::%attacker%'s uuid::creeperQuest}
      send "&eYou have killed %{quest::%attacker%'s uuid::creeperQuest} - 1%&e/50 Creepers!" to attacker
      if {quests::%attacker%'s uuid::creeperQuest} > 50:
        send "&eYou have completed the following quest:" to attacker
        send "" to attacker
        send "&eKill 50 Creepers" to attacker
        delete {quests::%attacker%'s uuid::creeperQuest}
        tokenReward(attacker)
  if victim is spider:
    if {quests::%attacker%'s uuid::spiderQuest} is set:
      add 1 to {quests::%attacker%'s uuid::spiderQuest}
      send "&eYou have killed %{quest::%attacker%'s uuid::spiderQuest} - 1%&e/50 Spiders!" to attacker
      if {quests::%attacker%'s uuid::spiderQuest} > 50:
        send "&eYou have completed the following quest:" to attacker
        send "" to attacker
        send "&eKill 50 Spiders" to attacker
        delete {quests::%attacker%'s uuid::spiderQuest}
        tokenReward(attacker)
  if victim is enderman:
    if {quests::%attacker%'s uuid::endermanQuest} is set:
      add 1 to {quests::%attacker%'s uuid::endermanQuest}
      send "&eYou have killed %{quest::%attacker%'s uuid::endermanQuest} - 1%&e/50 Endermen!" to attacker
      if {quests::%attacker%'s uuid::endermanQuest} > 50:
        send "&eYou have completed the following quest:" to attacker
        send "" to attacker
        send "&eKill 50 Endermen" to attacker
        delete {quests::%attacker%'s uuid::endermanQuest}
        tokenReward(attacker)

on break:
  if {quests::%player%'s uuid::break150Quest} is set:
    add 1 to {quests::%player%'s uuid::break150Quest}
    send "&eYou have broken %{quests::%player%'s uuid::break150Quest} - 1%&e/150 Blocks" to player
    if {quests::%player%'s uuid::break150Quest} > 150
      send "&eYou have completed the following quest:" to player
      send "" to player
      send "&eBreak 150 Blocks" to player
      delete {quests::%player%'s uuid::break150Quest}
      tokenReward(player)
  if {quests::%player%'s uuid::break200Quest} is set:
    add 1 to {quests::%player%'s uuid::break200Quest}
    send "&eYou have broken %{quests::%player%'s uuid::break150Quest} - 1%&e/200 Blocks" to player
    if {quests::%player%'s uuid::break200Quest} > 200
      send "&eYou have completed the following quest:" to player
      send "" to player
      send "&eBreak 200 Blocks" to player
      delete {quests::%player%'s uuid::break200Quest}
      tokenReward(player)
  if {quests::%player%'s uuid::192cobbleQuest} is set:
    if event-block is stone or cobblestone:
      add 1 to {quests::%player%'s uuid::192cobbleQuest}
      send "&eYou have broken %{quests::%player%'s uuid::192cobbleQuest} - 1%&e/192 Cobblestone" to player
      if {quests::%player%'s uuid::192cobbleQuest} > 192:9
      send "&eYou have completed the following quest:" to player
      send "" to player
      send "&eBreak 192 Cobblestone" to player
      delete {quests::%player%'s uuid::192cobbleQuest}
      tokenReward(player)
 
Status
Not open for further replies.