Solved Teleport kinda

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

Status
Not open for further replies.

TigerPvPzzz

Active Member
Feb 24, 2017
109
2
0
25
Hello there.

I have made a little "Sumo" script, and i really need help with 1 last thing.
Its on danish tho, but i have a problem. When players actualy are joined in the sumo event, idk how to actualy tp 2 players at time, so they are going into the arena that i have made.

EDIT:
I ran into some problems
I can't get this to work very well, and idk how to fix it.
 
Last edited:
Hello there.

I have made a little "Sumo" script, and i really need help with 1 last thing.
Its on danish tho, but i have a problem. When players actualy are joined in the sumo event, idk how to actualy tp 2 players at time, so they are going into the arena that i have made.

Code:
Command /Sumo [<text>] [<text>] [<Number>]:
    Trigger:
        If arg-1 is not set:
            If command sender has permission "{@perm}":
                Send "&7-----&l( &a&lSumo &7&l)&7-----"
                Send " "
                Send "    &3Admin Commands:          "
                Send ""
                Send "&7- &a/Sumo SetLobby &7(&bNavn&7) &7- &3Sætter Sumo Lobby"
                Send "&7- &a/Sumo DelLobby &7(&bNavn&7) &7- &3Fjerner Sumo Lobby"
                Send "&7- &a/Sumo TP &7(&bNavn&7) &7- &3Teleporter dig til Sumo"
                Send "&7- &a/Sumo Setspawn &7(&bNavn&7) (&bNr.&7) &7- &3Sætter Sumo spawn punkt inde i arenaen"
                Send "&7- &a/Sumo Delspawn &7(&bNavn&7) (&bNr.&7) &7- &3Fjerner Sumo spawn punkt inde i arenaen"
                Send "&7- &a/Sumo List &7- &3Giver dig en liste over Sumo Lobbyer"
                Send " "
                Send "    &3Spiller Commands:"
                Send " "
                Send "&7- &a/Sumo Host &7- &3Host et Sumo &7- &3Kræver en &a&lDonator &3Rank"
                Send "&7- &a/Sumo Join &7- &3Joiner et Sumo event, Dog kun hvis Sumoet er i nedtællings fasen"
                Send "&7- &a/Sumo Leave &7- &3Leaver et igangværende Sumo Event"
                Send "&7- &a/Sumo Spec &7- &3Du kan se på et Sumo Event"
                Send " "
                Send "&7-----&l( &a&lSumo &7&l)&7-----"
            Else:
                Send "&7-----&l( &a&lSumo &7&l)&7-----"
                Send " "
                Send "&7- &a/Sumo Host &7- &3Host et Sumo &7- &3Kræver en &a&lDonator &3Rank"
                Send "&7- &a/Sumo Join &7- &3Joiner et Sumo event, Dog kun hvis Sumoet er i nedtællings fasen"
                Send "&7- &a/Sumo Leave &7- &3Leaver et igangværende Sumo Event"
                Send "&7- &a/Sumo Spec &7- &3Du kan se på et Sumo Event"
                Send " "
                Send "&7-----&l( &a&lSumo &7&l)&7-----"
        If arg-1 is "SetLobby":
            If player has permission "{@perm}":
                If arg-2 is set:
                    If {Sumo.Lobby.%arg-2%} is not set:
                        Set {Sumo.Lobby.%arg-2%} to Location of player
                        Add arg-2 to {Sumo.Lobbys::*}
                        Send "{@p} &aDu har nu sat Lobby til &3%arg-2%&a."
                    Else:
                        Send "{@p} {@f} &cLobby til &3%arg-2% &cer allerede sat!"
                Else:
                    Send "{@p} &3Brug: &a&l/Sumo SetLobby &7(&bNavn&7)"
            Else:
                Send "{@p} {@f} {@pb}"
        If arg-1 is "tp":
            If player has permission "{@perm}":
                If arg-2 is set:
                    If {Sumo.Lobby.%arg-2%} is set:
                        Teleport player to {Sumo.Lobby.%arg-2%}
                        Send "{@p} &aDu teleportede til &3%arg-2%&a."
                    Else:
                        Send "{@p} {@f} &cLobbyen &3%arg-2% &cFindes ikke!"
                Else:
                    Send "{@p} &3Brug: &a&l/Sumo tp &7(&bNavn&7)"
            Else:
                Send "{@p} {@f} {@pb}"
        If arg-1 is "DelLobby":
            If player has permission "{@perm}":
                If arg-2 is set:
                    If {Sumo.Lobby.%arg-2%} is set:
                        Delete {Sumo.Lobby.%arg-2%}
                        Delete {Sumo.spawn.1.%arg-2%}
                        Delete {Sumo.spawn.2.%arg-2%}
                        Remove arg-2 from {Sumo.Lobbys::*}
                        Send "{@p} &aDu fjernede Lobbyen for &3%arg-2%&a!"
                    Else:
                        Send "{@p} {@f} &cLobbyen &3%arg-2% &cFindes ikke!"
                Else:
                    Send "{@p} &3Brug: &a&l/Sumo DelLobby &7(&bNavn&7)"
            Else:
                Send "{@p} {@f} {@pb}"
        If arg-1 is "SetSpawn":
            If player has permission "{@perm}":
                If arg-2 is set:
                    If {Sumo.Lobby.%arg-2%} is set:
                        If arg-3 is set:
                            If arg-3 is less than 3:
                                If {Sumo.Spawn.%arg-3%.%arg-2%} is not set:
                                    Set {Sumo.Spawn.%arg-3%.%arg-2%} to location of player
                                    Send "{@p} &aDu har nu sat &3%arg-3%. &bSpawn &atil &3%arg-2%&a."
                                Else:
                                    Send "{@p} {@f} &cDer er allerede sat spawn &3%arg-3% &ctil &3%arg-2%&c!"
                            Else:
                                Send "{@p} {@f} &cDer kan ikke være flere end &32 &cspawn punkter pr. Lobby!"
                        Else:
                            Send "{@p} &3Brug: &a&l/Sumo Setspawn &7(&bNavn&7) (&bNr.&7)"
                    Else:
                        Send "{@p} {@f} &cLobbyen &3%arg-2% &cFindes ikke!"
                Else:
                    Send "{@p} &3Brug: &a&l/Sumo Setspawn &7(&bNavn&7) (&bNr.&7)"
            Else:
                Send "{@p} {@f} {@pb}"
        If arg-1 is "Delspawn":
            If player has permission "{@perm}":
                If arg-2 is set:
                    If {Sumo.Lobby.%arg-2%} is set:
                        If arg-3 is set:
                            If arg-3 is less than 3:
                                If {Sumo.Spawn.%arg-3%} is set:
                                    Delete {Sumo.Spawn.%arg-3%}
                                    Send "{@p} &aDu har nu fjernet &3%arg-3%. &bSpawn &atil &3%arg-2%&a."
                                Else:
                                    Send "{@p} {@f} &cspawn punket &3%arg-3% &cFindes ikke til &3%arg-2%&c!"
                            Else:
                                Send "{@p} {@f} &cDer kan ikke være flere end &32 &cspawn punkter pr. Lobby!"
                        Else:
                            Send "{@p} &3Brug: &a&l/Sumo DelSpawn &7(&bNavn&7) (&bNr.&7)"
                    Else:
                        Send "{@p} {@f} &cLobbyen &3%arg-2% &cFindes ikke!"
                Else:
                    Send "{@p} &3Brug: &a&l/Sumo DelSpawn &7(&bNavn&7) (&bNr.&7)"
            Else:
                Send "{@p} {@f} {@pb}"
        If arg-1 is "List":
            If command sender has permission "{@perm}":
                Send "&3%{Sumo.Lobbys::*}%"
        If arg-1 is "Host":
            If command sender has permission "{@hp}":
                If {Sumo.Igang} is not set:
                    If {Sumo.nt} is not set:
                        Set {Sumo.nt} to 60
                        Broadcast "&7-----&l( &a&lSumo &7&l)&7-----"
                        Broadcast " "
                        Broadcast "&3%Command sender% &aHar lige hostet et &3&lSumo&a!"
                        Broadcast " "
                        Broadcast "&6/Sumo join &7- &a60 Sekunder &7til det starter!"
                        Broadcast " "
                        Broadcast "&7-----&l( &a&lSumo &7&l)&7-----"
                        wait 15 seconds
                        Set {Sumo.nt} to 45
                        Broadcast "{@p} &a%{Sumo.nt}% &aSekunder &7til det starter! &6/Sumo Join"
                        wait 15 seconds
                        Set {Sumo.nt} to 30
                        Broadcast "{@p} &a%{Sumo.nt}% &aSekunder &7til det starter! &6/Sumo Join"
                        Wait 20 seconds
                        Set {Sumo.nt} to 10
                        Broadcast "{@p} &a%{Sumo.nt}% &aSekunder &7til det starter! &6/Sumo Join"
                        Wait 5 seconds
                        Set {Sumo.nt} to 5
                        Broadcast "{@p} &a%{Sumo.nt}% &aSekunder &7til det starter! &6/Sumo Join"
                        Wait 1 second
                        Set {Sumo.nt} to 4
                        Broadcast "{@p} &a%{Sumo.nt}% &aSekunder &7til det starter! &6/Sumo Join"
                        Wait 1 second
                        Set {Sumo.nt} to 3
                        Broadcast "{@p} &a%{Sumo.nt}% &aSekunder &7til det starter! &6/Sumo Join"
                        Wait 1 second
                        Set {Sumo.nt} to 2
                        Broadcast "{@p} &a%{Sumo.nt}% &aSekunder &7til det starter! &6/Sumo Join"
                        Wait 1 second
                        Set {Sumo.nt} to 1
                        Send "{@p} &a%{Sumo.nt}% &aSekund &7til det starter! &6/Sumo Join"
                        wait 1 second
                        Delete {Sumo.nt}
                        Set {Sumo.Igang} to true
                        Broadcast "&7-----&l( &a&lSumo &7&l)&7-----"
                        Broadcast " "
                        Broadcast "&3&lSumo &aEr nu begyndt!"
                        Broadcast " "
                        Broadcast "&7Joinede spillere ialt: &a%{Sumo.Joined.All}%"
                        Broadcast " "
                        Broadcast "&7-----&l( &a&lSumo &7&l)&7-----"
                    Else:
                        Send "{@p} {@f} &cDer er allerede en Nedtælling igang! &6/Sumo Join"
                Else:
                    Send "{@p} {@f} &cDer er allerede et &3&lSumo Event &cigang!"
            Else:
                Send "{@p} {@f} {@pb}"
        If arg-1 is "Join":
            If {Sumo.nt} is set:
                If {Sumo.Joined.%player%} is not set:
                    Add 1 to {Sumo.Joined.All}
                    Add player to {Sumo.Joined.list::*}
                    Set {Sumo.Joined.%player%} to true
                    Teleport player to {Sumo.Lobby.Original}
                    Send "{@p} &3%Player% &6Joinede eventet! &aDer er nu &7%{Sumo.Joined.All}% &aspillere joined!" to {Sumo.Joined.List::*}
                Else:
                    Send "{@p} {@f} &cDu er allerede med i dette event!"
            Else:
                Send "{@p} {@f} &cDer er ikke en Nedtælling i gang lige nu!"
        If arg-1 is "Leave":
            If {Sumo.Joined.%player%} is true:
                Delete {Sumo.Joined.%player%}
                Remove 1 from {Sumo.joined.All}
                Remove player from {Sumo.Joined.list::*}
                execute console command "/Spawn %player%"
                Send "{@p} &3%Player% &cForlod eventet! &fDer er nu &7%{Sumo.Joined.All}% &fspillere joined!" to {Sumo.Joined.List::*}
                Send "{@p} &cDu forlod eventet"
            Else:
                Send "{@p} {@f} &cDu er ikke med i eventet!"
                      
                      
                      
Command /Cleartest:    #This is only for testing
    Trigger:
        Delete {Sumo.Igang}
        Delete {Sumo.Joined.%player%}
        Delete {Sumo.Joined.All}
        Delete {Sumo.joined.list::*}
Just like you did here?:
code_language.skript:
Teleport player to {Sumo.Lobby.%arg-2%}
 
code_language.skript:
set {_player1} to random element of {Joined.list::*}
set {_player2} to random element of {Joined.list::*}

teleport {_player1} to wherever
teleport {_player2} to wherever
 
code_language.skript:
set {_player1} to random element of {Joined.list::*}
set {_player2} to random element of {Joined.list::*}

teleport {_player1} to wherever
teleport {_player2} to wherever
Ty <3
[doublepost=1500504966,1500468766][/doublepost]EDIT:
I ran into some problems
I can't get this to work very well, and idk how to fix it.
 
Last edited by a moderator:
You cant just slap 166 lines of code on the forums and expect us to dig through it to find what doesnt work. be more specific, what doesnt work very well and where in the code is the issue
 
You cant just slap 166 lines of code on the forums and expect us to dig through it to find what doesnt work. be more specific, what doesnt work very well and where in the code is the issue
Line 107
The thing that is not working:
When there are 2 players back in the sumo event, Its supossed to teleport players to spawn and remove there effects, But its not. I have tried many things, but none of them worked.

EDIT:
And also, that "Set {_Player} to random element of {Variable} there is a decent chance of a player to get both {_Player} if you understand, Can that be fixed?
[doublepost=1500560363,1500507043][/doublepost]
You cant just slap 166 lines of code on the forums and expect us to dig through it to find what doesnt work. be more specific, what doesnt work very well and where in the code is the issue
Line 166 to 206, is supposed to make the first part of the sumo run, But the random element of {Sumo.Joined.list::*} could possible be the same person, that gets both {_Player} and thats a problem, because then only 1 person gets teleported into the arena, and then the sumo is ruined.

Line 234 to 293, is supossed to make a new round in the sumo going on, but that dosen't really work, the players dont lose there effect's and the sumo is ruined again. ( SRY For bad english )
 
either remove the player from the list after you select them or make a while loop to keep selecting a player until its not the first player you selected

and you didnt post lines 234-293
 
and you didnt post lines 234-293
Oh i see, my bad I took the lines from my Notepad++

Line 39 to 79
And
Line 107 to 166 - And im gonna try to remove the player from list
[doublepost=1500590048,1500561466][/doublepost]Just forget about it, i figured it out.
 
Status
Not open for further replies.