scoreboard players set @s spectator_time 0
gamemode adventure @s
tag @s add playing

$execute if entity @s[team=blue] run tp @s @n[tag=blue_spawn,scores={map_id=$(map_id)}]
$execute if entity @s[team=red] run tp @s @n[tag=red_spawn,scores={map_id=$(map_id)}]
$execute at @s run tp @s ~ ~ ~ facing entity @n[tag=map_center,scores={map_id=$(map_id)}] eyes
execute at @s run tp @s ~ ~ ~ ~ 0
execute at @s run fill ~-1 ~ ~-1 ~1 ~2 ~1 minecraft:air replace #minecraft:wool

effect give @s minecraft:resistance 3 17 true
effect give @s minecraft:strength 3 1 true
effect give @s minecraft:instant_health 1 20 true
effect give @s minecraft:fire_resistance 5 0 true
effect give @s minecraft:regeneration 4 10 true

function pctf:logic/player/gear

xp set @s 0 levels
xp set @s 0 points

tag @s remove moved

scoreboard players set @s spell_cooldown1 0
scoreboard players set @s spell_cooldown2 0
scoreboard players set @s spell_cooldown3 0

tag @s add respawn_temp
execute as @e[type=marker,tag=time_warp_scroll] if score @s real_ID = @n[tag=respawn_temp] real_ID run kill @s
tag @s remove respawn_temp

attribute @s minecraft:jump_strength base set 0.42
attribute @s minecraft:fall_damage_multiplier base set 1