#need help with combat skript
1 messages · Page 1 of 1 (latest)
what else should i use instead if u dont mind me asking?
probably just an on join should suffice
It still shows up with the same thing im not sure if im doing it right or wrong since im new to skript but is the on join supposed to be at the very top? or will i change the options and on join?
combat_time: 15 # Combat timer duration in seconds
blocked_commands: "spawn, home, tpa, warp" # List of blocked commands during combat
on join:
set {combat::%uuid of player%} to 0
command /spawn:
description: Teleport to spawn
executable by: players
trigger:
if {combat::%uuid of player%} > 0:
send "&c&lYou can't use /spawn while in combat!" to player
else:
teleport player to location(0, 0, 0, world "world")
send "&a&lTeleported to spawn!" to player
on damage:
if attacker is a player:
if victim is a player:
set {combat::%uuid of attacker%} to {@combat_time}
set {combat::%uuid of victim%} to {@combat_time}
send "&c&lYou are now in combat! Don't log out for {@combat_time} seconds!" to attacker
send "&c&lYou are now in combat! Don't log out for {@combat_time} seconds!" to victim
every second:
loop all players:
if {combat::%uuid of loop-player%} > 0:
subtract 1 from {combat::%uuid of loop-player%}
if {combat::%uuid of loop-player%} is 0:
send "&a&lYou are no longer in combat." to loop-player
on command:
if {combat::%uuid of player%} > 0:
if command is {@blocked_commands}:
cancel event
send "&c&lYou can't use this command while in combat!" to player
on quit:
if {combat::%uuid of player%} > 0:
loop all items in player's inventory:
drop loop-item at player's location
clear player's inventory
broadcast "&c%player% logged out during combat and dropped their loot!"
on teleport:
if {combat::%uuid of player%} > 0:
cancel event
send "&c&lYou can't teleport while in combat!" to player```
nvm got it thanks a lot!
That's nowhere in the file as I can see