Alexander01998 Actually the reason that I'm using .tp 2 times is because I want the same key to enable freecam when pressed the first time and to teleport to a location and disable freecam when pressed the 2nd time.
Now, if I were to use .tp only once, then I couldn't get it to do both these things mentioned above. Here's why -
Let's say I use the command ".tp ~ ~ ~; freecam; .setcheckbox .tp disable_freecam toggle", then let's go step by step what happens -
When pressed the first time, it just enables freecam overall (initially disable freecam checkbox was unchecked).
Now I fly to the location that I want to teleport to and press the keybind again, now first it sends .tp and this time .tp disables freecam and the player gets teleported to the location that I flew to, but then it enables freecam, so now the player is in the position where I had wanted him to be teleported to, but I'm still in freecam.
This might raise the question that why even use .setcheckbox .tp disable_freecam toggle, but if I didn't use it then I'll just end up teleporting to the same location when pressing the keybind the first time.
Okay so using .tp before freecam is not working then maybe we can try using .tp afterwards like this -
"freecam; .tp ~ ~ ~; .setcheckbox .tp disable_freecam toggle"
Well, let's analyse it -
When pressed the first time, it again enables freecam overall.
Now when pressing the keybind for the 2nd time it would first disable the freecam and the .tp will just teleport you to the position where you already were.
So yeah that's why I'm using 2 rounds of .tp, however I'm open to suggestions, and if you have any ideas on how we can improve this, please don't hesitate to share them with me.
Also btw I'm not really sure that doing multiple rounds of teleport would help with server anti cheat, I say this because when you bind multiple commands to the same key, then upon pressing the key those commands get sent with negligible amount of time between them, meaning that both the .tp commands get sent so quickly that the anti cheat wouldn't have time to react in between the commands and would just teleport you back after the whole chain of commands has been sent, so it's not gonna be like - first the 1st .tp gets sent, then anti cheat teleports you back, then the 2nd anti cheat gets sent and you end up teleporting to where you wanted to.
I'm saying this based just on observation though. What observation you ask? Well so I conducted an experiment by binding ".vclip 20; .vclip -10" to the same key. Now upon pressing the key, it teleports me 10 blocks upward (duh), but you see, in the server I tested this in, if there are solid blocks at the location where you'll end up after doing .vclip then you won't vclip at all and it just rubberbands. So I went to a location where there were solid blocks after a vertical height of 14 blocks from the location where I was standing at initially and pressed the keybind, not this time I was successfully able to vclip 10 blocks upward, this proves that when first .vclip 20 teleported me into the solid blocks, then before anti cheat could teleport me back, .vclip -10 just vclipped me back down to the place where there weren't solid blocks. I'm not really sure that this thesis is right though, meaning I'm not sure about the anti cheat thing.