Skript Help

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

Brandawg

Member
May 8, 2017
19
0
1
23
For some reason if your one class you gain every ability so if you shift you go invis and you are resistant to poison I check in pex and it says I only have dwarf perm any ideas?

code_language.skript:
on join:
    if {race.%player%} is true:
        stop
    else:
        set {race.%player%} to false
    wait 1 second
    if {race.%player%} is false:
        open chest with 1 rows named "Choose Your Character's race..." to player
        format slot 3 of player with gold sword named "&e&lHuman" with lore "&ePassive: While Running they are Granted Strength" to close then run [make player execute command "racehuman"]
        format slot 4 of player with gold shovel named "&c&lDwarf" with lore "&cPassive: While Sneaking they Turn Invisible" to close then run [make player execute command "racedwarf"]
        format slot 5 of player with gold hoe named "&5Mage" with lore "&5Passive: While Poisoned they are cleared of it" to close then run [make player execute command "racemage"]
        
on inventory close:
    wait 1 tick
    if {race.%player%} is false:
        open chest with 1 rows named "Choose Your Character's race..." to player
        format slot 3 of player with gold sword named "&e&lHuman" with lore "&ePassive: While Running they are Granted Strength" to close then run [make player execute command "racehuman"]
        format slot 4 of player with gold shovel named "&c&lDwarf" with lore "&cPassive: While Sneaking they Turn Invisible" to close then run [make player execute command "racedwarf"]
        format slot 5 of player with gold hoe named "&5Mage" with lore "&5Passive: While Poisoned they are cleared of it" to close then run [make player execute command "racemage"]
    
command /racehuman:
    trigger:
        if {race.%player%} is true:
            send "&c&l(!) &cYou have already choosen a race!"
        if {race.%player%} is false:
            set {race.%player%} to true
            make console execute command "/pex user %player% add human"
            make console execute command "/pex user %player% suffix "" &f&l(&bHuman&f&l)"""
            make console execute command "/spawn %player%"
            loop 100 times:
                send "" to player
            loop 1 times:
                broadcast "&a&l(!) &a%player% has joined the &bHumans"
            
command /racedwarf:
    trigger:
        if {race.%player%} is true:
            send "&c&l(!) &cYou have already choosen a race!"
        if {race.%player%} is false:
            set {race.%player%} to true
            make console execute command "/pex user %player% add dwarf"
            make console execute command "/pex user %player% suffix "" &f&l(&cDwarf&f&l)"""
            make console execute command "/spawn %player%"
            loop 100 times:
                send "" to player
            loop 1 times:
                broadcast "&a&l(!) &a%player% has joined the &cDwarves"
    
command /racemage:
    trigger:
        if {race.%player%} is true:
            send "&c&l(!) &cYou have already choosen a race!"
        if {race.%player%} is false:
            set {race.%player%} to true
            make console execute command "/pex user %player% add mage"
            make console execute command "/pex user %player% suffix "" &f&l(&5Mage&f&l)"""
            make console execute command "/spawn %player%"
            loop 100 times:
                send "" to player
            loop 1 times:
                broadcast "&a&l(!) &a%player% has joined the Mages"
command /racechange:
    trigger:
        if {race.%player%} is false:
            send "&c&l(!) &cYou need to choose a race first!"
        if {race.%player%} is true:
            set {race.%player%} to false
            make console execute command "/pex user %player% remove human"
            make console execute command "/pex user %player% remove dwarf"
            make console execute command "/pex user %player% remove mage"
            kick player
every 5 seconds:
    loop all players:
        if loop-player has {warrior.%player%} is true:
            loop-player is sprinting
            apply strength to loop-player for 6 seconds
        if loop-player has permission "dwarf":
            loop-player is sneaking
            apply invisibility to loop-player for 6 seconds
        if loop-player has permission "mage":
            loop-player is poisoned
            cure the loop-player from poison
 
Why dont use variables instead of command and pex?


Ex: {race.%uuid of player%}

It's way easier and this way you don't have to depend on PEX.
 
Why dont use variables instead of command and pex?


Ex: {race.%uuid of player%}

It's way easier and this way you don't have to depend on PEX.
how would I do that I have tried but it is not working I did something like this
code_language.skript:
variables:
    {human} = 0
    {dwarf} = 0
    {mage} = 0

on join:
    if {race.%player%} is true:
        stop
    else:
        set {race.%player%} to false
    wait 1 second
    if {race.%player%} is false:
        open chest with 1 rows named "Choose Your Character's race..." to player
        format slot 3 of player with gold sword named "&e&lHuman" with lore "&ePassive: While Running they are Granted Strength" to close then run [make player execute command "racehuman"]
        format slot 4 of player with gold shovel named "&c&lDwarf" with lore "&cPassive: While Sneaking they Turn Invisible" to close then run [make player execute command "racedwarf"]
        format slot 5 of player with gold hoe named "&5Mage" with lore "&5Passive: While Poisoned they are cleared of it" to close then run [make player execute command "racemage"]
        
on inventory close:
    wait 1 tick
    if {race.%player%} is false:
        open chest with 1 rows named "Choose Your Character's race..." to player
        format slot 3 of player with gold sword named "&e&lHuman" with lore "&ePassive: While Running they are Granted Strength" to close then run [make player execute command "racehuman"]
        format slot 4 of player with gold shovel named "&c&lDwarf" with lore "&cPassive: While Sneaking they Turn Invisible" to close then run [make player execute command "racedwarf"]
        format slot 5 of player with gold hoe named "&5Mage" with lore "&5Passive: While Poisoned they are cleared of it" to close then run [make player execute command "racemage"]
    
command /racehuman:
    trigger:
        if {race.%player%} is true:
            send "&c&l(!) &cYou have already choosen a race!"
        if {race.%player%} is false:
            set {race.%player%} to true
            make console execute command "/pex user %player% add human"
            make console execute command "/pex user %player% suffix "" &f&l(&bHuman&f&l)"""
            make console execute command "/spawn %player%"
            loop 100 times:
                send "" to player
            loop 1 times:
                broadcast "&a&l(!) &a%player% has joined the &bHumans"
            
command /racedwarf:
    trigger:
        if {race.%player%} is true:
            send "&c&l(!) &cYou have already choosen a race!"
        if {race.%player%} is false:
            set {race.%player%} to true
            make console execute command "/pex user %player% add dwarf"
            make console execute command "/pex user %player% suffix "" &f&l(&cDwarf&f&l)"""
            make console execute command "/spawn %player%"
            loop 100 times:
                send "" to player
            loop 1 times:
                broadcast "&a&l(!) &a%player% has joined the &cDwarves"
    
command /racemage:
    trigger:
        if {race.%player%} is true:
            send "&c&l(!) &cYou have already choosen a race!"
        if {race.%player%} is false:
            set {race.%player%} to true
            make console execute command "/pex user %player% add mage"
            make console execute command "/pex user %player% suffix "" &f&l(&5Mage&f&l)"""
            make console execute command "/spawn %player%"
            loop 100 times:
                send "" to player
            loop 1 times:
                broadcast "&a&l(!) &a%player% has joined the Mages"
command /racechange:
    trigger:
        if {race.%player%} is false:
            send "&c&l(!) &cYou need to choose a race first!"
        if {race.%player%} is true:
            set {race.%player%} to false
            make console execute command "/pex user %player% remove human"
            make console execute command "/pex user %player% remove dwarf"
            make console execute command "/pex user %player% remove mage"
            kick player
every 2 seconds:
    loop all players:
        if loop-player has {human::%player%}:
            loop-player is sprinting:
                apply strength to loop-player for 2 seconds
        if loop-player has permission "dwarf":
            loop-player is sneaking:
                apply invisibility to loop-player for 2 seconds       
        if loop-player has permission "mage":
            loop-player is poisoned:
                cure the loop-player from poison
 
Here you go
Everything works for me
code_language.skript:
on join:
    if {race.%uuid of player%} is true:
        stop
    else:
        set {race.%uuid of player%} to false
    wait 1 second
    if {race.%uuid of player%} is false:
        open chest with 1 rows named "Choose Your Character's race..." to player
        format slot 3 of player with gold sword named "&e&lHuman" with lore "&ePassive: While Running they are Granted Strength" to close then run [make player execute command "racehuman"]
        format slot 4 of player with gold shovel named "&c&lDwarf" with lore "&cPassive: While Sneaking they Turn Invisible" to close then run [make player execute command "racedwarf"]
        format slot 5 of player with gold hoe named "&5Mage" with lore "&5Passive: While Poisoned they are cleared of it" to close then run [make player execute command "racemage"]
      
on inventory close:
    wait 1 tick
    if {race.%uuid of player%} is false:
        open chest with 1 rows named "Choose Your Character's race..." to player
        format slot 3 of player with gold sword named "&e&lHuman" with lore "&ePassive: While Running they are Granted Strength" to close then run [make player execute command "racehuman"]
        format slot 4 of player with gold shovel named "&c&lDwarf" with lore "&cPassive: While Sneaking they Turn Invisible" to close then run [make player execute command "racedwarf"]
        format slot 5 of player with gold hoe named "&5Mage" with lore "&5Passive: While Poisoned they are cleared of it" to close then run [make player execute command "racemage"]
  
command /racehuman:
    trigger:
        if {race.%uuid of player%} is true:
            send "&c&l(!) &cYou have already choosen a race!"
        if {race.%uuid of player%} is false:
            set {race.%uuid of player%} to true
            set {racec.%uuid of player%} to "human"
            # make console execute command "/pex user %player% add human"
            # make console execute command "/pex user %player% suffix "" &f&l(&bHuman&f&l)"""
            # make console execute command "/spawn %player%"
            loop 100 times:
                send "" to player
            loop 1 times:
                broadcast "&a&l(!) &a%player% has joined the &bHumans"
          
command /racedwarf:
    trigger:
        if {race.%uuid of player%} is true:
            send "&c&l(!) &cYou have already choosen a race!"
        if {race.%uuid of player%} is false:
            set {race.%uuid of player%} to true
            set {racec.%uuid of player%} to "dwarf"
            # make console execute command "/pex user %player% add dwarf"
            # make console execute command "/pex user %player% suffix "" &f&l(&cDwarf&f&l)"""
            # make console execute command "/spawn %player%"
            loop 100 times:
                send "" to player
            loop 1 times:
                broadcast "&a&l(!) &a%player% has joined the &cDwarves"
  
command /racemage:
    trigger:
        if {race.%uuid of player%} is true:
            send "&c&l(!) &cYou have already choosen a race!"
        if {race.%uuid of player%} is false:
            set {race.%uuid of player%} to true
            set {racec.%uuid of player%} to "mage"
         #   make console execute command "/pex user %player% add mage"
         #   make console execute command "/pex user %player% suffix "" &f&l(&5Mage&f&l)"""
         #   make console execute command "/spawn %player%"
            loop 100 times:
                send "" to player
            loop 1 times:
                broadcast "&a&l(!) &a%player% has joined the Mages"
                
command /racechange:
    trigger:
        if {race.%uuid of player%} is false:
            send "&c&l(!) &cYou need to choose a race first!"
        if {race.%uuid of player%} is true:
            set {race.%uuid of player%} to false
            delete {racec.%uuid of player%}       
            #make console execute command "/pex user %player% remove human"
          #  make console execute command "/pex user %player% remove dwarf"
           # make console execute command "/pex user %player% remove mage"
            kick player
            
every 2 seconds:
    loop all players:
        if "%{racec.%uuid of loop-player%}%" is "human":
            loop-player is sprinting:
                apply strength to loop-player for 2 seconds
        else if "%{racec.%uuid of loop-player%}%" is "dwarf":
            loop-player is sneaking:
                apply invisibility to loop-player for 2 seconds     
        else if "%{racec.%uuid of loop-player%}%" is "mage":
            loop-player is poisoned:
                cure the loop-player from poison
 
Status
Not open for further replies.