Sumo skript not working

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

Samaib

Member
Mar 24, 2020
10
0
0
I get no errors but it's not teleporting anyone to {sumopos1} or {sumopos2}.

Code:
command /sumostart:
    permission: sumo.use
    trigger:
        set {sumo.start} to true
        broadcast "&a&lA Sumo event is starting soon! Type /event join Sumo to join!"
        wait 100 ticks
        teleport a random player out of {sumos} to {sumopos1}
        teleport a random player out of {sumos} to {sumopos2}
                
        
command /sumoend:
    permission: sumo.use
    trigger:
        set {sumo.start} to false
        broadcast "&c&lThe Sumo event has ended!"
        loop all players:
            {sumo::%loop-player%} is true:
                execute loop-player command "/spawn"
                set {sumo::%loop-player%} to false
    
command /sumopos1:
    permission: sumo.use
    trigger:
        set {sumopos1} to location of player
    
command /sumopos2:
    permission: sumo.use
    trigger:
        set {sumopos2} to location of player
    
command /sumospec:
    permission: sumo.use
    trigger:
        set {sumospec} to location of player
    
command /event join [<text>]:
    trigger:
        if arg-1 is "sumo":
            if {sumo.start} is true:
                teleport player to {sumospec}
                send "&a&lJoined the Sumo event!"
                set {sumo::%player%} to true
                add player to {sumos}
            else:
                send "&cThere isn't a Sumo event active!"
 
Try this (didn't test it)
Code:
command /event join [<text>]:
    trigger:
        if arg-1 is "sumo":
            if {sumo.start} is true:
                teleport player to {sumospec}
                send "&a&lJoined the Sumo event!"
                set {sumo::%player%} to true
                add player to {sumos::*}
            else:
                send "&cThere isn't a Sumo event active!"
        else:
            send "&cNo such event! Events: &4Sumo"

command /sumostart:
    permission: sumo.use
    trigger:
        set {sumo.start} to true
        broadcast "&a&lA Sumo event is starting soon! Type /event join Sumo to join!"
        wait 100 ticks
        set {_s} to the size of {sumos::*}
        teleport {sumos::%{_num}%} to {sumopos1}
        remove {sumos::%{_num}%} from {sumos::*}
        clear {_num}
        clear {_s}
        set {_s} to the size of {sumos::*}
        set {_num} to a random integer between 1 and {_s}
        teleport {sumos::%{_num}%} to {sumopos2}
        remove {sumos::%{_num}%} from {sumos::*}
[doublepost=1587971305,1587971204][/doublepost]also no need to use
Code:
wait 100 ticks
instead use seconds
Code:
wait 5 seconds
Every 20 ticks = 1 second
 
I don't think it's a good idea to teleport a player "out" of a region, as simply teleporting them to a new place does that exact thing.
I'm not too sure, but I think putting this (see picture) messes things up
upload_2020-4-27_10-8-26.png

try this code instead
Code:
teleport a random player to {sumopos1}
 
I don't think it's a good idea to teleport a player "out" of a region, as simply teleporting them to a new place does that exact thing.
I'm not too sure, but I think putting this (see picture) messes things up
View attachment 4594
try this code instead
Code:
teleport a random player to {sumopos1}
I'd agree with you but he is trying to teleport someone who joined a queue hints "{sumo::*}"
 
I'd agree with you but he is trying to teleport someone who joined a queue hints "{sumo::*}"
well, he could just set a temp variable to a random element out of the list


---------------------------------------------------------------------------------------------------------
As I understod, you wanted to pick someone random, so this should work
Code:
loop all players:
    add loop-player to {_list::*}
    set {_randomplayer} to random element out of {_list::*}
    teleport {_randomplayer} to {lokation}

@Samaib
 
Yeah he could just use random element, but looping all players wont work unless he out the queued players in a variable, Anyways both ways should work
 
Yeah he could just use random element, but looping all players wont work unless he out the queued players in a variable, Anyways both ways should work
Yeah it was just an example, he could also just loop the variable, and use loop-value instead of loop-player
 
well, he could just set a temp variable to a random element out of the list


---------------------------------------------------------------------------------------------------------
As I understod, you wanted to pick someone random, so this should work
Code:
loop all players:
    add loop-player to {_list::*}
    set {_randomplayer} to random element out of {_list::*}
    teleport {_randomplayer} to {lokation}

@Samaib

I tried this but it's still not teleporting anyone. Got no errors but it wont work.
 
Try this (didn't test it)
Code:
command /event join [<text>]:
    trigger:
        if arg-1 is "sumo":
            if {sumo.start} is true:
                teleport player to {sumospec}
                send "&a&lJoined the Sumo event!"
                set {sumo::%player%} to true
                add player to {sumos::*}
            else:
                send "&cThere isn't a Sumo event active!"
        else:
            send "&cNo such event! Events: &4Sumo"

command /sumostart:
    permission: sumo.use
    trigger:
        set {sumo.start} to true
        broadcast "&a&lA Sumo event is starting soon! Type /event join Sumo to join!"
        wait 100 ticks
        set {_s} to the size of {sumos::*}
        teleport {sumos::%{_num}%} to {sumopos1}
        remove {sumos::%{_num}%} from {sumos::*}
        clear {_num}
        clear {_s}
        set {_s} to the size of {sumos::*}
        set {_num} to a random integer between 1 and {_s}
        teleport {sumos::%{_num}%} to {sumopos2}
        remove {sumos::%{_num}%} from {sumos::*}
[doublepost=1587971305,1587971204][/doublepost]also no need to use
Code:
wait 100 ticks
instead use seconds
Code:
wait 5 seconds
Every 20 ticks = 1 second
Try this
 
Status
Not open for further replies.