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

    Joined:
    Nov 21, 2020
    Messages:
    38
    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

    Joined:
    Nov 21, 2020
    Messages:
    38
    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
     

Share This Page

Loading...