execute store result score #cave_spiders temp run random value 10..30

execute as @e[type=cave_spider] at @s run tp @s ~ ~-1000 ~

execute if entity @s[team=red] at @n[type=marker,tag=red_spawn] run function pctf:logic/items/lucky_block/outcomes/negative/team/cave_spiders/loop
execute if entity @s[team=blue] at @n[type=marker,tag=blue_spawn] run function pctf:logic/items/lucky_block/outcomes/negative/team/cave_spiders/loop

tellraw @a[distance=..250] ["",{"selector":"@s","color":"white"},{"text":"'s ","color":"white"},{"text":"spawn has been infested!","color":"dark_red"}]

particle minecraft:item_cobweb ~ ~ ~ 4 4 4 0 500