execute as @a[distance=..250,gamemode=!spectator] run ride @s dismount
execute as @e[type=horse,distance=..250] at @s run tp @s ~ ~-1000 ~
execute as @a[distance=..250,gamemode=!spectator,team=red] at @s run summon horse ~ ~ ~ {DeathLootTable:"none",Team:"red",Tame:1b,Variant:0,equipment:{body:{id:"minecraft:leather_horse_armor",count:1,components:{"minecraft:dyed_color":16718876}},saddle:{id:"minecraft:saddle",count:1}},attributes:[{id:"minecraft:jump_strength",base:1},{id:"minecraft:movement_speed",base:0.3}]}
execute as @a[distance=..250,gamemode=!spectator,team=blue] at @s run summon horse ~ ~ ~ {DeathLootTable:"none",Team:"blue",Tame:1b,Variant:0,equipment:{body:{id:"minecraft:leather_horse_armor",count:1,components:{"minecraft:dyed_color":685311}},saddle:{id:"minecraft:saddle",count:1}},attributes:[{id:"minecraft:jump_strength",base:1},{id:"minecraft:movement_speed",base:0.3}]}
execute as @a[distance=..250,gamemode=!spectator] at @s run ride @s mount @n[type=horse]

tellraw @a[distance=..250] ["",{"text":"WE RIDE TOGETHER!","bold":true,"color":"yellow"},{"text":"\n","bold":true},{"text":"WE FIGHT TOGETHER!","bold":true,"color":"gold"},{"text":"\n","bold":true},{"text":"WE DIE TOGETHER!","bold":true,"color":"red"}]
playsound minecraft:item.goat_horn.sound.6 player @a ~ ~ ~ 10 1.5