#Im making a skript that you can toggle pvp for everyone every 30 minutes.

1 messages · Page 1 of 1 (latest)

median moss
#

This is either automatic or manuall but i dont know how to make it so right above the hunger bar there is a thing that says PvP= (either on or off)

#
    {time} = 2
    {lives.%player%} = 10
    {yes} = true

on load:
    while {yes} = true:
        wait "%{time}% minutes" parsed as time span 
        set {time} to 30
        if {pvpcheck} = false:
            enable PvP in all worlds
            send title "&c&l⚔️" with subtitle "&4&lPVP has been enabled in all worlds!" to all players for 1 second
            set {pvpcheck} to true
        else if {pvpcheck} = true:
            disable PvP in all worlds
            send title "&c&l🗡️🗡" with subtitle "&4&lPVP has been disabled in all worlds!" to all players for 1 second
            set {pvpcheck} to false

command togglepvp:
    permission: perm.op
    trigger:
        if {pvpcheck} = true:
            set {pvpcheck} to false
            disable PvP in all worlds
            send title "&c&l🗡️🗡" with subtitle "&4&lPVP has been disabled!" to all players for 1 second
        else:
            enable PvP in all worlds
            send title "&c&l⚔️" with subtitle "&4&lPVP has been enabled!" to all players for 1 second
            set {pvpcheck} to true

on death of player:
    if {lives.%victim%} = 1:
        execute console command "/ban %victim%"
    else:
        remove 1 from {lives.%victim%}
        send "&4&lYou lost a life. your now at %{lives.victim}% lives"
                       
command /givelife [<offlineplayer>] [<text>]:
    permission: perm.op
    trigger:
        add arg-2 {lives.%player's UUID%} to arg-1   

every 1 second:
    loop all players:
        set loop-player's tablist name to "%loop-player's UUID%    %{lives.%loop-player's UUID%}%"```
#

Also this dont work

   permission: perm.op
   trigger:
       add arg-2 {lives.%player's UUID%} to arg-1```
opal stratus
#

send action bar "text" to player

opal stratus
#

not really sure what you expect it to accomplish

valid crest
#

i would make {lives.%player%} a list and use uuids; {lives::%player's uuid%}
.

#

wait "%{time}% minutes" parsed as time span
why not just set {time} to a timespan? set it to 30 minutes, then just wait {time}
.

#
            set {pvpcheck} to false```instead of setting this to false, you can just delete it to save space
.
#
    if {lives.%victim%} = 1:
        execute console command "/ban %victim%"
    else:
        remove 1 from {lives.%victim%}
        send "&4&lYou lost a life. your now at %{lives.victim}% lives"```dont use console commands when skript has perfectly functional effects. amd shouldnt you be removing the life regardless before the if statements? then you can check if it `= 0` and ban, then you can delete the variable to save space too
.
#
    loop all players:
        set loop-player's tablist name to "%loop-player's UUID%    %{lives.%loop-player's UUID%}%"```dont loop all players for this, the tablist doesnt need to be refreshed, just set their names on join and on death if you want it to show their life count
.
#

in all of your commands the arguments are optional, you can make them mandatory by removing the square brackets.
<mandatory> [<optional>]
.

valid crest
#

Why do you have {lives.%player%} in one part, and then switch to {lives.%player's UUID%}?

median moss
#

one you fixed but i cant add it do i don onlineplayer?

opal stratus
#

sure

median moss
#

i ned more help

valid crest
#

for the command?

median moss
#

it didnt work

#

theres no error but it doesnt add

median moss
valid crest
#

well i used a list

median moss
#

list of what?

valid crest
#

are you still checking for the variable using .?

median moss
#

it is

valid crest
#

which is always better.

median moss
#

there is still no errors for that line but it doesnt add lives

valid crest
#

well..

median moss
#
    {time} = 2
    {lives::%player% = 10
    {yes} = true

on load:
    while {yes} = true:
        wait "%{time}% minutes" parsed as time span 
        set {time} to 30
        if {pvpcheck} = false:
            enable PvP in all worlds
            send title "&c&l⚔️" with subtitle "&4&lPVP has been enabled in all worlds!" to all players for 1 second
            set {pvpcheck} to true
        else if {pvpcheck} = true:
            disable PvP in all worlds
            send title "&c&l🗡️🗡" with subtitle "&4&lPVP has been disabled in all worlds!" to all players for 1 second
            set {pvpcheck} to false

command togglepvp:
    permission: perm.op
    trigger:
        if {pvpcheck} = true:
            set {pvpcheck} to false
            disable PvP in all worlds
            send title "&c&l🗡️🗡" with subtitle "&4&lPVP has been disabled!" to all players for 1 second
        else:
            enable PvP in all worlds
            send title "&c&l⚔️" with subtitle "&4&lPVP has been enabled!" to all players for 1 second
            set {pvpcheck} to true

on death of player:
    if {lives.%victim%} = 1:
        execute console command "/ban %victim%"
    else:
        remove 1 from {lives.%victim%}
        send "&4&lYou lost a life. your now at %{lives.victim}% lives"
                       
command /givelife <player> <text>:
    permission: perm.op
    trigger:
        if {lives.arg-1} > 10:
            add arg-2 to {lives::%arg-1's uuid%}
        else:
            

every 1 second:
    loop all players:
        set loop-player's tablist name to "%loop-player%    %{lives.%loop-player%}%"    
        
command /banneditems:
    permission: perm.op
    trigger:
        set {_banneditems} to a new chest inventory with 6 rows with name "banned items"
        loop 54 times:
            set slot loop-value-1 of {_banneditems} to {banneditems::%loop-value%}
        open {_banneditems} for player
        
command /addbanneditem <text>:
    permission: perm.op
    trigger:
        remove arg-1 parsed as item from {banneditems::*}
        send "&4&lSuccessfully added %arg-1 parsed as item% to banned items!"
    
command /removebanneditem <text>:
    permission: perm.op
    trigger:
        add arg-1 parsed as item to {banneditems::*}
        send "&4&lSuccesfully removed %arg-1% from banned items!"
        
on load:
    while {yes} = true:
        wait 10 seconds
        loop all players:
            loop {banneditems::*}:
                remove all "%loop-value-2%" parsed as item from inventory of loop-value-1
    if {pvpcheck} = true:
        send action bar "&#890000&lPvP: On"
    else if {pvpcheck} = false:
        send action bar "&#890000&lPvP: Off"```
#

@valid crest

#
    permission: perm.op
    trigger:
        if {lives.arg-1} > 10:
            add arg-2 to {lives::%arg-1's uuid%}
        else:
            cancel event```
valid crest
#

honesly just make add/remove an argument
.

#

thats not how hex codes work in skript, # is a comment, meaning the rest of the line is invisible. Hex codes look like this: <##ffffff>