Solved Regen From Experience Levels

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

PotteryTNT

Member
Jul 21, 2017
41
0
0
22
Category: UHC

Suggested name: Level Health

Spigot/Skript Version: PaperSpigot 1.8.8, Skript 2.2 (yes just 2.2)

What I want:
There is 4 different stages of health you can use experience for which are:

Low - 5xp - 3s Regen

Medium - 10xp - 5s Regen

High - 15xp - 8s Regen

Overpowered - 25xp - 12s Regen


Infinite amount of uses as long as they have enough experience for it.


Ideas for commands:
/lvh on, /lvh off, /lvh toggle

/lvh low

/lvh medium

/lvh high

/lvh op


Ideas for permissions: idk, lvh.uhc

When I'd like it by: Possibly by next week
 
So if I'm currect you basically want a xp shop, and if you have a certain amout of xp you can type a command, it'll take the xp then give you regeneration? what would the /lvh on, /lvh off, and /lvh toggle do? also do you mean xp levels or points?
 
Well as it will be used for a UHC, I would need a way of enabling this so it allows all this and a way to disable it so no one can use this at all unless it is enabled. But yeah your description is correct, even if it was a GUI of some sort it could work.
 
Code:
options:
    #Prefix to this skript.
    prefix: &8[&c&lZABRID&8]
 
 
on load:
    if {lvh.toggle} is not set:
        set {lvh.toggle} to true
command /levelhealth [<text>]:
    aliases: /lvh, /lvlhealth, /levelh
    trigger:
        if arg 1 is "toggle":
            if sender has permission "lvh.admin":
                if {lvh.toggle} is true:
                    set {lvh.toggle} to false
                    message "{@prefix} &7Level-Health has been disabled."
                if {lvh.toggle} is false:
                    set {lvh.toggle} to true
                    message "{@prefix} &7Level-Health has been enabled."
            else:
                message "{@prefix} &cNo Permission."
        if arg 1 is "on":
            if sender has permission "lvh.admin":
                set {lvh.toggle} to true
                message "{@prefix} &7Level-Health has been enabled."
            else:
                message "{@prefix} &cNo Permission."
        if arg 1 is "off":
            if sender has permission "lvh.admin":
                set {lvh.toggle} to false
                message "{@prefix} &7Level-Health has been disabled."
            else:
                message "{@prefix} &cNo Permission."
        if arg 1 is "low":
            if {lvh.toggle} is true:
                if player's level < 5:
                    send "{@prefix} &cInsufficient xp level."
                    send "{@prefix} &4(Required Level: 5)"
                    stop
                else:
                    remove 5 from player's level
                    apply regeneration 1 to player for 3 seconds
                    send "{@prefix} &7You have been given &cRegeneration 1 &7for &c3 &7seconds."
                    stop
            else:
                message "{@prefix} &cThis feature has been disabled."
        if arg 1 is "medium":
            if {lvh.toggle} is true:
                if player's level < 10:
                    send "{@prefix} &cInsufficient xp level."
                    send "{@prefix} &4(Required Level: 10)"
                    stop
                else:
                    remove 10 from player's level
                    apply regeneration 1 to player for 5 seconds
                    send "{@prefix} &7You have been given &cRegeneration 1 &7for &c5 &7seconds."
                    stop
            else:
                message "{@prefix} &cThis feature has been disabled."
        if arg 1 is "high":
            if {lvh.toggle} is true:
                if player's level < 15:
                    send "{@prefix} &cInsufficient xp level."
                    send "{@prefix} &4(Required Level: 15)"
                    stop
                else:
                    remove 15 from player's level
                    apply regeneration 1 to player for 8 seconds
                    send "{@prefix} &7You have been given &cRegeneration 1 &7for &c8 &7seconds."
                    stop
            else:
                message "{@prefix} &cThis feature has been disabled."
        if arg 1 is "op":
            if {lvh.toggle} is true:
                if player's level < 25:
                    send "{@prefix} &cInsufficient xp level."
                    send "{@prefix} &4(Required Level: 25)"
                    stop
                else:
                    remove 25 from player's level
                    apply regeneration 1 to player for 12 seconds
                    send "{@prefix} &7You have been given &cRegeneration 1 &7for &c12 &7seconds."
                    stop
            else:
                message "{@prefix} &cThis feature has been disabled."
I made this for 1.8 tho it should work in other versions (you may need skquery but not 100% sure

also didn't test so lmk of any errors
Also the Admin permission is lvh.admin (this perm allows you to turn on and off lvh)
 
Last edited: