teleportation does not work

  • 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 community!

    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!

NickQr

New Member
Oct 2, 2023
8
0
1
so i created a sumo skript i set the positions and the lobby and for some reason it doesnt teleport the player this is the teleportation
every second:
loop all players:
if {inProgress} is true:
if loop-player is in world "Sumo":
if {atposition1} is false:
set {players} to random element out of {players::*} parsed as player
teleport {players} to {position1}
remove 1 from {players::*}
set {positiontp1} to false
set {atposition1} to true
wait 10 ticks
stop
else if {atposition2} is false:
set {players} to random element out of {players::*} parsed as player
teleport {players} to {position2}
remove 1 from {players::*}
set {positiontp2} to false
set {atposition2} to true
wait 10 ticks
stop
else:
else:
stop
and here are the variables that is used
variables:
inProgress = false
{joined::%player%} = false
{players::*} = 0
atposition1 = false
atposition2 = false
positiontp1 = true
positiontp2 = true
it doesnt give out any errors just some warnings which are empty configuration sections
 
Hey, your code doesnt make sense at all, you are removing 1 from the list where should be players, so why dont you remove player instead of number.
You can try this:
Code:
on load:
    set {inProgress} to false
    set {atposition1} to false
    set {atposition2} to false
    set {positiontp1} to true
    set {positiontp2} to true
on join:
    set {joined::%player%} to false
every second:
    loop all players:
        if {inProgress} is true:
            if loop-player is in world "Sumo":
                if {atposition1} is false:
                    set {_players} to random element out of {players::*}
                    teleport {_players} to {position1}
                    remove {_players} from {players::*}
                    set {positiontp1} to false
                    set {atposition1} to true
                    wait 10 ticks
                    stop
                else if {atposition2} is false:
                    set {_players} to random element out of {players::*}
                    teleport {_players} to {position2}
                    remove {_players} from {players::*}
                    set {positiontp2} to false
                    set {atposition2} to true
                    wait 10 ticks
                    stop
                else:
                    stop
also make sure, that {players::*} contains players and not something else..
next time use code format if you are sending code.
 
Hey, your code doesnt make sense at all, you are removing 1 from the list where should be players, so why dont you remove player instead of number.
You can try this:
Code:
on load:
    set {inProgress} to false
    set {atposition1} to false
    set {atposition2} to false
    set {positiontp1} to true
    set {positiontp2} to true
on join:
    set {joined::%player%} to false
every second:
    loop all players:
        if {inProgress} is true:
            if loop-player is in world "Sumo":
                if {atposition1} is false:
                    set {_players} to random element out of {players::*}
                    teleport {_players} to {position1}
                    remove {_players} from {players::*}
                    set {positiontp1} to false
                    set {atposition1} to true
                    wait 10 ticks
                    stop
                else if {atposition2} is false:
                    set {_players} to random element out of {players::*}
                    teleport {_players} to {position2}
                    remove {_players} from {players::*}
                    set {positiontp2} to false
                    set {atposition2} to true
                    wait 10 ticks
                    stop
                else:
                    stop
also make sure, that {players::*} contains players and not something else..
next time use code format if you are sending code.
it doesnt teleport