Welcome to SkriptTools.net!

SkriptTools is now part of the skUnity family! skUnity will keep SkriptTools running, updating and adding new features.


- You can now search scripts by author by doing "author:name". For example: "author:nfell2009"

- Login to SkriptTools using your skUnity account to save your favourite scripts and come back to them

Login

Script Viewer

View the code of the script directly in your browser without downloading anything.

Current File: Jobs.sk - Download / View on the skUnity Parser

function jobLoader(p: player , type: text , start: integer):
  set {_inv} to chest
  open {_inv} named "Povolani: %{_type}%" with 3 rows to {_p}
  wait a tick

  set {_num} to {_start}
  set {_items::*} to yaml list "Job.%{_type}%" from file "Jobs.yml"
  if {_start} is 1:
    set slot 22 of {_p}'s current inventory to red wool named "<red>Jit Zpet"
  loop {_items::*}:
    if {JobLevel.%{_p}%.%{Job.%{_p}%}%} is not set:
      set {JobLevel.%{_p}%.%{Job.%{_p}%}%} to 1
    set {_AcItem::*} to loop-value split at "|"
    set {_AcItem::1} to {_AcItem::1} parsed as item
    set {_AcItem::2} to {_AcItem::2} parsed as number
    if {JobLevel.%{_p}%.%{Job.%{_p}%}%} is set:
      set {_AcItem::2} to {_AcItem::2} * {JobLevel.%{_p}%.%{Job.%{_p}%}%} / 10
    else:
      set {_AcItem::2} to {_AcItem::2} / 10
    set {_AcItem::3} to colored {_AcItem::3}

    set slot {_num} of {_p}'s current inventory to {_AcItem::1} named "%{_AcItem::3}%" with lore "<white>Si vydelas <purple>%{_AcItem::2}% <reset>Money!"
    add 1 to {_num}
    if {_num} = 8:
      add 3 to {_num}

function checkJobProg(p: player):
  if {JobProg.%{_p}%} >= {JobLevel.%{_p}%}*700:
    add 1 to {JobLevel.%{_p}%.%{Job.%{_p}%}%}
    set {JobProg.%{_p}%} to 0
    send "[<green>Jobs<reset>] Tvuj level v praci <aqua>%{Job.%{_p}%}%<reset> byl navysen na %{JobLevel.%{_p}%.%{Job.%{_p}%}%}% level!" to {_p}

command /jobs:
  aliases: job
  trigger:
    set {_inv} to chest
    open {_inv} named "Prace" with 1 rows to player
    wait a tick
    if {Job.%player%} is "Nezamestany":
      set slot 0 of player's current inventory to iron pickaxe named "<aqua>Hornik" with lore "<white>Vydelavej si penize tezenim rud!||   <yellow>Levym <reset>- Zjistit vice informaci! ||   <yellow>Pravym - <reset>Vybrat toto povolani!"
      set slot 1 of player's current inventory to iron shovel named "<aqua>Kopac" with lore "<white>Vydelavej si penize tezenim zeminy a kameni!||   <yellow>Levym <reset>- Zjistit vice informaci! ||   <yellow>Pravym - <reset>Vybrat toto povolani!"
      set slot 2 of player's current inventory to iron sword named "<aqua>Bojovnik" with lore "<white>Vydelavej si penize zabijenim monster!||   <yellow>Levym <reset>- Zjistit vice informaci! ||   <yellow>Pravym - <reset>Vybrat toto povolani!"
      set slot 4 of player's current inventory to iron hoe named "<aqua>Farmar" with lore "<white>Vydelavej si penize farmarenim!||   <yellow>Levym <reset>- Zjistit vice informaci! ||   <yellow>Pravym - <reset>Vybrat toto povolani!"
      set slot 3 of player's current inventory to iron axe named "<aqua>Drevorubec" with lore "<white>Vydelavej si penize sekanim stromu!||   <yellow>Levym <reset>- Zjistit vice informaci! ||   <yellow>Pravym - <reset>Vybrat toto povolani!"
      set slot 8 of player's current inventory to red wool named "<red>Zavrit menu"
    else:
      jobLoader(player , {Job.%player%} , 9)
      wait 2 ticks
      if {JobLevel.%player%.%{Job.%player%}%} < 11:
        set slot 4 of player's current inventory to xp bottle named "<green>Postup v praci" with lore "<purple>%{JobProg.%player%}% <reset>z <purple>%{JobLevel.%player%.%{Job.%player%}%}*700% <yellow>Bodu||<white>Do levelu <green>%{JobLevel.%player%}+1%<reset> !"
      else:
        set slot 4 of player's current inventory to xp bottle named "<green>Tato prace je na MAXIMALNIM LEVELU!"
      set slot 22 of player's current inventory to barrier named "<red>Opustit praci!" with lore "<red>Pokud opustit praci bude ulozen pouze level praci!"



on inventory click:
  if inventory name of player's current inventory is "Prace":
    if clicked item is not red wool or air:
      cancel event
      set {PrevPage.%player%} to "Jobs"
      if "%click type%" contains "LEFT":
        jobLoader(player , "%uncolored name of clicked item%" , 1)
        stop
      if {Job.Leave.%player%} is not set:
        set {Job.Leave.%player%} to now
        add 10 minutes to {Job.Leave.%player%}
      set {_diff} to difference between {Job.Leave.%player%} and now
      if {_diff} is greater than 5 minutes:
        if "%click type%" contains "RIGHT":
          set {Job.%player%} to "%uncolored name of clicked item%"
          set {JobLevel.%player%.%{Job.%player%}%} to 1
          set {JobProg.%player%} to 0
          send "[<green>Jobs<reset>] Povolani %name of clicked item%<reset> bylo zvoleno!"
          close player's inventory
          make player execute command "/jobs"
      elsE:
        send "[<green>Jobs<reset>] Povolani muzes menit s prodlevou 5 minut!"
  if inventory name of player's current inventory contains "Povolani":
    cancel event
    if clicked item is barrier:
      cancel event
      set {JobLevel.%player%.%{Job.%player%}%} to 1
      delete {JobProg.%player%}
      set {Job.%player%} to "Nezamestany"
      close player's inventory
      set {Job.Leave.%player%} to now
      send "[<green>Jobs<reset>] Prace byla opustena a level byl ulozen!"

on break:
  if {Job.%player%} is "Kopac" or "Hornik" or "Drevorubec" or "Farmar":
    set {_Block::*} to yaml list "Job.%{Job.%player%}%" from file "Jobs.yml"

    checkJobProg(player)

    loop {_Block::*}:
      set {_AcItem::*} to loop-value split at "|"
      set {_AcItem::1} to {_AcItem::1} parsed as item
      set {_AcItem::2} to {_AcItem::2} parsed as number
      set {_AcItem::2} to {_AcItem::2} * {JobLevel.%player%.%{Job.%player%}%}/ 10
      if {_AcItem::4} is "Break":
        if event-block is {_AcItem::1}:
          add 1 to {JobProg.%player%}
          add {_AcItem::2} to player's balance
          stop
      if {_AcItem::4} is "Harvest":
        set {_AcItem::5} to {_AcItem::5} parsed as item
        if event-block is {_AcItem::5}:
          add {_AcItem::2} to player's balance
          add 1 to {JobProg.%player%}
          stop

on death:
  if victim is not a player:
    if {Job.%attacker%} is "Bojovnik":
      set {_Block::*} to yaml list "Job.%{Job.%attacker%}%" from file "Jobs.yml"

      checkJobProg(player)

      loop {_Block::*}:
        set {_AcItem::*} to loop-value split at "|"
        set {_AcItem::2} to {_AcItem::2} parsed as number
        set {_AcItem::2} to {_AcItem::2} * {JobLevel.%player%.%{Job.%player%}%} / 10
        set {_AcItem::5} to {_Block::5} parsed as entity type
        if {_AcItem::4} is "Kill":
          if victim is {_AcItem::5}:
            add {_AcItem::2} to player's balance
            add 1 to {JobProg.%player%}
            stop