Sure. Here's the new skript.
Code:
on damage of player:
if attacker is a player:
if {combatTag.%attacker%} isn't set:
send "&cYou are now in combat." to attacker
set {combatTag.%attacker%} to 30
else:
set {combatTag.%attacker%} to 30
on damage of player:
if attacker is a player:
if {combatTag.%victim%} isn't set:
send "&cYou are now in combat." to victim
set {combatTag.%victim%} to 30
else:
set {combatTag.%victim%} to 30
every second:
loop all players:
if {combatTag.%loop-player%} is set:
if {combatTag.%loop-player%} > 0:
remove 1 from {combatTag.%loop-player%}
else:
delete {combatTag.%loop-player%}
send "&aYou are no longer in combat." to loop-player
on command:
if {combatTag.%player%} is set:
cancel event
send "&cYou cannot use commands while in combat."
on disconnect:
if {combattag.%player%} is set:
spawn a villager
set {combatvillager::%spawned villager%::%player's uuid%::*} to true
set the name of the spawned villager to "%event-player%"
add "{NoAI:1}" to nbt of last spawned entity
set {inventory::%player's uuid%::*} to all items in player's inventory
set {logged.%player's uuid%} to true
on death:
if victim is a villager:
if {combatvillager::%victim%::%player's uuid%::*} is true:
set {waiting.%player's uuid%} to true
wait 45 seconds
set {waiting.%player's uuid%} to false
drop all items in inventories {inventory::%player's uuid%::*}
set {killed.%player's uuid%} to true
on join:
if {logged.%player's uuid%} is true:
if {killed.%player's uuid%} is true:
if {waiting.%player's uuid%} is false:
clear player's inventory
set {logged.%player's uuid%} to false
set {killed.%player's uuid%} to false
if {waiting.%player's uuid%} is true:
set {waiting.%player's uuid%} to fals
set {logged.%player's uuid%} to false
set {killed.%player's uuid%} to false
[doublepost=1577059146,1577058820][/doublepost]So I didnt really read your full post I just added that villager part, didnt send them to spawn or set your variables to specific values like you wanted. Here is that if you still want it: (I also had a few typos and indentation errors in the previous one so u will want this skript) (THIS CODE IS ALSO SHORTENED SO THE FILE SIZE IS SMALLER REE)
Code:
on damage of player:
if attacker is a player:
if {combatTag.%victim%} isn't set:
send "&cYou are now in combat." to victim
set {combatTag.%victim%} to 30
wait 30 seconds
send "&aYou are no longer in combat." to victim
else:
set {combatTag.%victim%} to 30
wait 30 seconds
send "&aYou are no longer in combat." to victim
if {combatTag.%attacker%} isn't set:
send "&cYou are now in combat." to attacker
set {combatTag.%attacker%} to 30
wait 30 seconds
send "&aYou are no longer in combat." to attacker
else:
set {combatTag.%attacker%} to 30
wait 30 seconds
send "&aYou are no longer in combat." to attacker
on command:
if {combatTag.%player%} is set:
cancel event
send "&cYou cannot use commands while in combat."
on disconnect:
if {combattag.%player%} is set:
spawn a villager
set {combatvillager::%spawned villager%::%player's uuid%::*} to true
set the name of the spawned villager to "%event-player%"
add "{NoAI:1}" to nbt of last spawned entity
set {inventory::%player's uuid%::*} to all items in player's inventory
set {logged.%player's uuid%} to true
on death:
if victim is a villager:
if {combatvillager::%victim%::%player's uuid%::*} is true:
set {waiting.%player's uuid%} to true
wait 45 seconds
set {waiting.%player's uuid%} to false
drop all items in inventories {inventory::%player's uuid%::*}
set {killed.%player's uuid%} to true
set {pvpTimer.%player%} to 1800
set {deathBan.%player%} to 600
on join:
if {logged.%player's uuid%} is true:
if {killed.%player's uuid%} is true:
if {waiting.%player's uuid%} is false:
clear player's inventory
set {logged.%player's uuid%} to false
set {killed.%player's uuid%} to false
execute console command "spawn %player%"
if {waiting.%player's uuid%} is true:
set {waiting.%player's uuid%} to false
set {logged.%player's uuid%} to false
set {killed.%player's uuid%} to false
[doublepost=1577074640][/doublepost]might not work but no errors sooo
Code:
on damage of player:
if attacker is a player:
if {combatTag.%victim%} isn't set:
send "&cYou are now in combat." to victim
set {combatTag.%victim%} to 30
wait 30 seconds
send "&aYou are no longer in combat." to victim
else:
set {combatTag.%victim%} to 30
wait 30 seconds
send "&aYou are no longer in combat." to victim
if {combatTag.%attacker%} isn't set:
send "&cYou are now in combat." to attacker
set {combatTag.%attacker%} to 30
wait 30 seconds
send "&aYou are no longer in combat." to attacker
else:
set {combatTag.%attacker%} to 30
wait 30 seconds
send "&aYou are no longer in combat." to attacker
on command:
if {combatTag.%player%} is set:
cancel event
send "&cYou cannot use commands while in combat."
on disconnect:
if {combattag.%player%} is set:
spawn a villager
set {combatvillager::%spawned villager%::%player's uuid%::*} to true
set the name of the spawned villager to "%event-player%"
add "{NoAI:1}" to nbt of last spawned entity
set {inventory::%player's uuid%::*} to all items in player's inventory
set {logged.%player's uuid%} to true
set {waiting2.%player's uuid%} to true
wait 45 seconds
set {waiting2.%player's uuid%} to false
set {combatvillager::%spawned villager%::%player's uuid%::*} to false
kill spawned villager
stop
on death:
if victim is a villager:
if {combatvillager::%victim%::%player's uuid%::*} is true:
set {waiting.%player's uuid%} to true
wait 45 seconds
set {waiting.%player's uuid%} to false
drop all items in inventories {inventory::%player's uuid%::*}
set {killed.%player's uuid%} to true
set {pvpTimer.%player%} to 1800
set {deathBan.%player%} to 600
on join:
if {logged.%player's uuid%} is true:
if {killed.%player's uuid%} is true:
if {waiting.%player's uuid%} is false:
clear player's inventory
set {logged.%player's uuid%} to false
set {killed.%player's uuid%} to false
execute console command "spawn %player%"
if {waiting.%player's uuid%} is true:
set {waiting.%player's uuid%} to false
set {logged.%player's uuid%} to false
set {killed.%player's uuid%} to false