1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

a mana system with a subtitle

Discussion in 'Requests' started by Grandfish, Feb 26, 2021.

  1. Grandfish

    Grandfish Member

    Joined:
    Feb 8, 2021
    Messages:
    13
    Likes Received:
    0
    hello

    so im creating an rpg/dungeons server and was wondering how to make a mana system. wut i did at first was use a scoreboard, with commands, but there were no good places to display it. So i started looking on the forums for mana systems, but there were none.

    so basically what i want is like a mana subtitle, and when u right click with certain items is lowers the thing. The mana subtitle would also slowly regenerate. Certain armor pieces would buff the mana thing.

    um i hope for u to be done by like idk the end of march 2021?!?!??

    im on a 1.16 minehut server
    --- Double Post Merged, Mar 6, 2021, Original Post Date: Feb 26, 2021 ---
    bump
     
  2. Orangesanta8415

    Supporter

    Joined:
    Nov 21, 2020
    Messages:
    40
    Likes Received:
    0
    I made kind of what you were looking for along with an aspect of the end to try it with! The player defaults with 250 mana but I'll keep working on it and updating you. IDK what addons it needs just search up 'Skript actionbar addon'. Anyway here is the code (Its pretty simple)

    Code (Text):
    1. on join:
    2.     set {mana.%player%} to 250
    3.  
    4. every 10 ticks:
    5.     loop all players:
    6.         send action bar "&b%{mana.%loop-player%}%&b/250" to loop-player
    7.  
    8. every 50 ticks:
    9.     loop all players:
    10.         if {mana.%loop-player%} is greater than 250:
    11.             stop
    12.         else:
    13.             add 25 to {mana.%loop-player%}
    14.  
    15. on rightclick with diamond sword:
    16.     name of player's tool is "&9Aspect of the End":
    17.         if {mana.%player%} is greater than 49:
    18.             add -50 to {mana.%player%}
    19.             send "&aUsed &6Instant Transmission&a! &b(-50 Mana)" to player
    20.             set {_aote.use.teleport.block} to block 8 in front of player
    21.             teleport player above {_aote.use.teleport.block}
    22.         else:
    23.             send "&cYou don't have enough mana to do that!" to player
    --- Double Post Merged, Mar 18, 2021, Original Post Date: Mar 18, 2021 ---
    There are also a couple of bugs which is where sometimes your mana will go 25 mana above the limit.
     
  3. Grandfish

    Grandfish Member

    Joined:
    Feb 8, 2021
    Messages:
    13
    Likes Received:
    0
    Thank you!!! i will try this when i can!!!!
    --- Double Post Merged, Mar 21, 2021, Original Post Date: Mar 18, 2021 ---
    so ive tweaked the skript a little, so it is now a system that is like this:
    Code (Text):
    1. every 10 ticks:
    2.     loop all players:
    3.         send action bar "&b%{mana.%loop-player%}%&b/%{maxmana.%loop-player%}% Mana" to loop-player
    4.  
    5. every 40 ticks:
    6.     loop all players:
    7.         if {mana.%loop-player%} is greater than or equal to {maxmana.%loop-player%}:
    8.             stop
    9.         else:
    10.             add 25 to {mana.%loop-player%}
    11.  
    12. on rightclick with diamond sword:
    13.     name of player's tool is "&9Aspect of the End":
    14.         if {mana.%player%} is greater than 49:
    15.             add -50 to {mana.%player%}
    16.             send "&aUsed &6Instant Transmission&a! &b(-50 Mana)" to player
    17.             set {_aote.use.teleport.block} to block 8 in front of player
    18.             teleport player above {_aote.use.teleport.block}
    19.         else:
    20.             send "&cYou don't have enough mana to do that!" to player
    21.  
    22. on join:
    23.     set {maxmana.%player%} to 100
    24.  
    25. command /reset:
    26.     trigger:
    27.         set {mana.%player%} to 100
    28.         set {maxmana.%player%} to 100
    , can you think of a method of fixing the bug where it goes above the limit?
     
  4. Orangesanta8415

    Supporter

    Joined:
    Nov 21, 2020
    Messages:
    40
    Likes Received:
    0
    Code (Text):
    1. every 10 ticks:
    2.     loop all players:
    3.         send action bar "&b%{mana.%loop-player%}%&b/%{maxmana.%loop-player%}% Mana" to loop-player
    4.  
    5. every 20 ticks:
    6.     loop all players:
    7.         if {mana.%loop-player%} equal to {maxmana.%loop-player%}:
    8.             stop
    9.         else:
    10.             add 10 to {mana.%loop-player%}
    11.  
    12. on rightclick with diamond sword:
    13.     name of player's tool is "&9Aspect of the End":
    14.         if {mana.%player%} is greater than 49:
    15.             add -50 to {mana.%player%}
    16.             send "&aUsed &6Instant Transmission&a! &b(-50 Mana)" to player
    17.             set {_aote.use.teleport.block} to block 8 in front of player
    18.             teleport player above {_aote.use.teleport.block}
    19.         else:
    20.             send "&cYou don't have enough mana to do that!" to player
    21.  
    22. on join:
    23.     set {maxmana.%player%} to 100
    24.  
    25. command /manareset:
    26.     trigger:
    27.         set {mana.%player%} to 100
    28.         set {maxmana.%player%} to 100




    ^ This might work
     
  5. no_min

    no_min Member

    Joined:
    Jun 8, 2022
    Messages:
    2
    Likes Received:
    0
    Code (Text):
    1. every 2 ticks:
    2.     loop all players:
    3.         send action bar "&b%{mana.%loop-player%}%&b/%{maxmana.%loop-player%}% Mana" to loop-player
    4.  
    5. every 20 ticks:
    6.     loop all players:
    7.         if {mana.%loop-player%} is greater than {maxmana.%loop-player%}:
    8.             set {mana.%loop-player%} to {maxmana.%loop-player%}
    9.             stop
    10.         else if {mana.%loop-player%} is smaller than {maxmana.%loop-player%}:
    11.            
    12.             add 5 to {mana.%loop-player%}
    13.  
    14. on rightclick with diamond sword:
    15.     if {mana.%player%} is greater than 49:
    16.         add -50 to {mana.%player%}
    17.         send "&aUsed &6Instant Transmission&a! &b(-50 Mana)" to player
    18.         set {_aote.use.teleport.block} to block 8 in front of player
    19.         teleport player above {_aote.use.teleport.block}
    20.     else:
    21.         send "&cYou don't have enough mana to do that!" to player
    22.  
    23. on join:
    24.     set {maxmana.%player%} to 100
    25.  
    26. command /manareset:
    27.     trigger:
    28.         set {mana.%player%} to 100
    29.         set {maxmana.%player%} to 100
    *Slightly modified.

    The above code did not restore the Mana of other players when their Mana was at Max.
    This may have worked fine in past versions, but it did not work correctly in the current version (minecraft 1.18.x skript 2.6.2), so I'm replying to a thread that is over a year old.
    There may be a better way to write this, but I'm a newbie, so please forgive me.
    Also, I'm using DeepL.
     

Share This Page

Loading...