#Im making a skript that you can toggle pvp for everyone every 30 minutes.
1 messages · Page 1 of 1 (latest)
{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```
send action bar "text" to player
so you're trying to add a string amount of {lives.%player's uuid%} to an offline player
not really sure what you expect it to accomplish
"i dont know how to make it so right above the hunger bar there is a thing that says PvP= (either on or off)"
^ that is called an action bar
.
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 to30 minutes, then justwait {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>]
.
i think you are trying to add lives to a specific player?
just make the second argument an integer and add arg-2 to {lives::%arg-1's uuid%}
Why do you have {lives.%player%} in one part, and then switch to {lives.%player's UUID%}?
@valid crest There is no longer an error when i reload the script on the
one you fixed but i cant add it do i don onlineplayer?
sure
can you explain it to me easier ive been skripting for like 3 days
i ned more help
for the command?
i literally gave you the line
i tried
well i used a list
list of what?
are you still checking for the variable using .?
it is
here i used ::
which is always better.
there is still no errors for that line but it doesnt add lives
{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 "󙒐&lPvP: On"
else if {pvpcheck} = false:
send action bar "󙒐&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```
