#How can i make a multiplayer checkpoint system?
1 messages · Page 1 of 1 (latest)
that works if a gold block is under u
so... just if you step on a gold block, your spawnpoint gets set?
yes
but when i tried it set spawn for everyone
when u got onn it
its hard
uhm just do execute as @a at @s if block ~ ~-1 ~ gold_block run spawnpoint @s
thank you so much!!1
wait
when i did it for a telrraw it spams it
yeah well that constantly runs the command, íf you need to avoid it, i recommend also giving the player a tag when they step on the gold block using the same method, and before that line do execute as @a[tag=!YOURTAG] at @s if block ~ ~-1 ~ gold_block run tellraw...
or a score if you have multiple checkpoints
and just have unique tags for each checkpoint like checkpoint1, 2, 3
score also works but tags are simpler
and it seems like you might want the simple method
ok
scoreboard yes, but it really depends on context of your checkpoints
with just a few checkpoints, tags are fine
both are fine, there is no difference
i have a couple..
but well, you have another problem
I imagine there is definitely some performance impact, checking a score value (that is always singular) or iterating an array that potentially grows to a size of 100+ if you have that many checkpoints.
no please stop
yes there are
so i'm guessing you dont want to have separate lines for each checkpoint
yes
then hold on
k
oh yeah we can do it with one tag
execute as @a[tag=!checkpoint] at @s if block ~ ~-1 ~ gold_block run tellraw...
execute as @a[tag=!checkpoint] at @s if block ~ ~-1 ~ gold_block run spawnpoint @s ~ ~ ~
execute as @a at @s unless block ~ ~-1 ~ gold_block run tag @s remove checkpoint
execute as @a at @s if block ~ ~-1 ~ gold_block run tag @s add checkpoint```
pretty unpolished but it'll work
hopefully
ima test
tick.mcfunc?
yes
yeah
it will not repeat as long as you stand on the gold block, but it will repeat if you step off and on (each time)
happy to help
i actually been trying this for 1 and a half hours
oh ! 😭
ty again @low kindle