Teleporting players with the same variable to one place

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

yogurtff

Member
Jan 26, 2025
23
3
3
47
So, im doing a new minigame for me and my friends. but theres one issue: when it teleports, it teleports all players to one place.

What i want:
-I want the players that has different value to teleport to a certain location
for example: if {example::%player%} = 1 then they will teleport to the world spawn. else they will get teleported to the 10k to 10k.

the code now:


if {takim::%player%} is equal to 2:
teleport player to location(278.00, -34.9, -1737.0, world "world", 90, 0) #blue
else if {takim::%player%} is equal to 1:
teleport player to location(278.00, -34.9, -1798.0, world "world", -90, 0) #red
 
So, im doing a new minigame for me and my friends. but theres one issue: when it teleports, it teleports all players to one place.

What i want:
-I want the players that has different value to teleport to a certain location
for example: if {example::%player%} = 1 then they will teleport to the world spawn. else they will get teleported to the 10k to 10k.

the code now:


if {takim::%player%} is equal to 2:
teleport player to location(278.00, -34.9, -1737.0, world "world", 90, 0) #blue
else if {takim::%player%} is equal to 1:
teleport player to location(278.00, -34.9, -1798.0, world "world", -90, 0) #red
Türkçe yaz anlamadım
 
So, im doing a new minigame for me and my friends. but theres one issue: when it teleports, it teleports all players to one place.

What i want:
-I want the players that has different value to teleport to a certain location
for example: if {example::%player%} = 1 then they will teleport to the world spawn. else they will get teleported to the 10k to 10k.

the code now:


if {takim::%player%} is equal to 2:
teleport player to location(278.00, -34.9, -1737.0, world "world", 90, 0) #blue
else if {takim::%player%} is equal to 1:
teleport player to location(278.00, -34.9, -1798.0, world "world", -90, 0) #red
Can you explain it more?
 
Türkçe yaz anlamadım
bak şimdi, diyelim {ışınlanma::%player%} = 3 tamam mı? bu adam 30k'ya 30k koordinatlarına ışınlansın. diğer değerlerdekiler ise diğer belirlenen koordinatlara gidecek. ama ben bunu yapmaya çalıştığımda komutu çalıştırınca sadece beni ışınlıyor çünkü komutu giren benim. buradaki %player% yazısının yerine * (aktif oyuncuların hepsi) yapınca ayrım yapmadan hepsini bir yere teleportluyor. bunu düzeltmenin bir yolu var mı? yani değeri 2 olan oyuncular bir yere ama diğerleri 3 olanlar başka bir yere gidecek gibi.
 
Can you explain it more?
look, lets say {teleport::%player%} equals to 3, right? this player should teleport to the 30k-30k coordinates. other variable values should teleport to a location that i set. but they are not teleporting and im the only one that teleports. when i change %player% to * (all the active players) it teleports all the players to a certain location. they are not seperated. is there a way to fix it? like, if player value is 2, they will teleport to a set location but if its 3, they will teleport to another location.
 
look, lets say {teleport::%player%} equals to 3, right? this player should teleport to the 30k-30k coordinates. other variable values should teleport to a location that i set. but they are not teleporting and im the only one that teleports. when i change %player% to * (all the active players) it teleports all the players to a certain location. they are not seperated. is there a way to fix it? like, if player value is 2, they will teleport to a set location but if its 3, they will teleport to another location.
Bro i couldn't understand about your language, are you using tr or eng :emoji_grinning: You don't have to use translate i thought you were a turk.

Anyways, to do that, you have to loop all players and edit your code aswell. It will run a code for each player. You can use loop-player to get a player.

Example:


Python:
loop all players:
    send loop-player to players

You can try this code and see what does it do. It will send a list of name of online players.
 
bak söyle türkçe mi yazayım ingilizce mi tribe giriyorum amk

anyways ill test that out asap. thanks for helping me :emoji_slight_smile:
 
bak söyle türkçe mi yazayım ingilizce mi tribe giriyorum amk

anyways ill test that out tomorrow. thanks for helping me :emoji_slight_smile:
hahahjfdasşjfa bide ingilizceyi nazik yazıp türkçeyi kaba yazmışsın amk bilerek ahjafjhldajlhfda.

Türkçe yaz. Bekliyom yarın yazarsın.
 
hahahjfdasşjfa bide ingilizceyi nazik yazıp türkçeyi kaba yazmışsın amk bilerek ahjafjhldajlhfda.

Türkçe yaz. Bekliyom yarın yazarsın.
şimdi test etmeye karar verdim, o koda nasıl entegre edebilirim şimdi ona bakcam
 
Code:
if {takim::%player%} is equal to 2:
            teleport player to location(278.00, -34.9, -1737.0, world "world", 180, 0) #blue
        else if {takim::%player%} is equal to 1:
            teleport player to location(278.00, -34.9, -1798.0, world "world", 0, 0) #red

buna entegre etmeme yardım eder misin?
can you help me integrate it to this code?
 
Code:
if {takim::%player%} is equal to 2:
            teleport player to location(278.00, -34.9, -1737.0, world "world", 180, 0) #blue
        else if {takim::%player%} is equal to 1:
            teleport player to location(278.00, -34.9, -1798.0, world "world", 0, 0) #red

buna entegre etmeme yardım eder misin?
can you help me integrate it to this code?


Python:
loop all players:
    if {takim::%loop-player%} is equal to 2:
        teleport loop-player to location(278.00, -34.9, -1737.0, world "world", 180, 0) #blue
    else if {takim::%loop-player%} is equal to 1:
        teleport loop-player to location(278.00, -34.9, -1798.0, world "world", 0, 0) #red
 
allah razı olsun <3 istersen birlikte oyunu deneyelim
god bless you <3 if you want we can test the game together
 
şuan komutu giriyorum ama ışınlanmıyorlar :/ tek sorun bu
now i enter the command, but they are not teleporting :/ the only problem is this
 
Python:
command /baslat:
    permission: yogurt.specialamk
    trigger:
        loop all players:
            if {takim::%loop-player%} is equal to 2:
                teleport loop-player to location(278.00, -34.9, -1737.0, world "world", 180, 0) #blue
            else if {takim::%loop-player%} is equal to 1:
                teleport loop-player to location(278.00, -34.9, -1798.0, world "world", 0, 0) #red
        add 1 to {tur}
        make console execute command "/fill 295 -29 -1790 260 -35 -1790 minecraft:tinted_glass" #red
        make console execute command "/fill 295 -29 -1744 260 -35 -1744 minecraft:tinted_glass" #blue
        send title "Oyun 10 saniye içinde başlıyor." with subtitle "&4%{skorred}%&f-&1%{skorblue}%" to all players for 3 seconds
        wait 5 seconds
        send title "Oyun 5 saniye içinde başlıyor." with subtitle "&4%{skorred}%&f-&1%{skorblue}%" to all players for 1 second
        wait 1 second
        send title "Oyun 4 saniye içinde başlıyor." with subtitle "&4%{skorred}%&f-&1%{skorblue}%" to all players for 1 second
        wait 1 second
        send title "Oyun 3 saniye içinde başlıyor." with subtitle "&4%{skorred}%&f-&1%{skorblue}%" to all players for 1 second
        wait 1 second
        send title "Oyun 2 saniye içinde başlıyor." with subtitle "&4%{skorred}%&f-&1%{skorblue}%" to all players for 1 second
        wait 1 second
        send title "Oyun 1 saniye içinde başlıyor." with subtitle "&4%{skorred}%&f-&1%{skorblue}%" to all players for 1 second
        wait 1 second
        message "&a-------------------------------------" to all players
        message "&aHer iki takıma da başarılar dileriz!" to all players
        message "&a%{tur}%. tur." to all players
        message "&a-------------------------------------" to all players
        make console execute command "/fill 295 -29 -1790 260 -35 -1790 minecraft:air" #red
        make console execute command "/fill 295 -29 -1744 260 -35 -1744 minecraft:air" #blue
 
daha uzun ama o tüm oyun resmen. bu koddan ben diğerlerine entegre ederim orasında sorun yok