#Player running command

1 messages · Page 1 of 1 (latest)

inner sun
#

I would like to figure out what to type for when a player runs a command
| if player runs command "/spawn" | I can not figure out what it should
be ive tried if player executed. etc. but it still doesnt work im trying to make it so when a player runs a command it stops it waits 1 second send smth etc then makes that played execute command

deep furnace
#

I don't know, maybe on command

terse nebula
inner sun
#

Im trying to make it so when a player runs /spawn [Essentials] that is like makes a cooldown because I do not know how to make rotations on skript it is too annoying to understand if so could you send a skript where when the players run the command (/spawn) it stops it then wait 5 seconds | make player execute spawn so like they tp to spawn after 5 seconds.

terse nebula
#

Sure

#
    permission: op
    trigger:
        set {spawn} to location of player
        send "set spawn to: %{spawn}%" to player
  
command /spawn:
    trigger:
        send "&bTeleporting you to Spawn in &c&l5 &bseconds."
   
        set {_cooldown} to 100
  
        while {_cooldown} is not 0:
  
            remove 1 from {_cooldown}
            
            wait a tick
  
        teleport executor to {spawn}

        send "&bTeleported to spawn"```
#

@inner sun

inner sun
#

let me try it out

#

if it does work thank you so much

terse nebula
#

After adding it

#

Do /setspawn

#

Then try /spawn

inner sun
#

Yeah I see the /setspawn + /spawn

terse nebula
#

K

inner sun
#

Now I do not know if that K was sarcastic / being rude or just "ok"

terse nebula
#

It was just an "ok"

inner sun
#

ok

#

For me it works sending the things but doesn't tp me

#

to spawn

#

oh nvm

#

didnt setspawn ;-;

#

forgo

#

Its works perfectly

#

just does this work "on combat: cancel event "

#

would that work or no

#

for like when they take dmg they

#

dont spawn

#

or move

terse nebula
#

I can probably make it

#

Like if the executor moves

#

It cancel

#
    permission: op
    trigger:
        set {spawn} to location of player
        send "set spawn to: %{spawn}%" to player
  
command /spawn:
    trigger:
        send "&bTeleporting you to Spawn in &c&l5 &bseconds."
   
        set {_cooldown} to 100
  
        set {_loc} to location of player
        while {_cooldown} is not 0:
  
            remove 1 from {_cooldown}
  
            if distance between {_loc} and player is not 0:
                send "&cYou have moved, teleportation cancelled."
                stop
  
            set {_loc} to location of player
            
            wait a tick
  
        teleport executor to {spawn}
        execute console command "/minecraft:clear %player%"
        execute console command "/effect clear %player%"
        send "&bTeleported to spawn"```
inner sun
#

does that count in a pixel?

#

or just 1 block it cancels?

terse nebula
#

If them move

#

It cancels

inner sun
#

ok

#

what is this meant to do ?

#

execute console command "/minecraft:clear %player%"
execute console command "/effect clear %player%"

deep furnace
#

clear clears their inventory, but not ender chest
effect clear clears their potion effects

#

if this is an smp, you might want to remove those last two

terse nebula
inner sun
#

what for?

#

like why

terse nebula
#

Like once the reach spawn

#

they get cleared

inner sun
#

I do not understand why the want their loot like cleared

#

I just removed that anyways if thats ok

#

I think it should be

#

Ques does it work for every1

#

wait let me add a permission thing

#

like to make it so theycan

terse nebula
#

You can just remove it

inner sun
#

kalki it works for me but other player's dont get tped

#

im operator if need

terse nebula
#

``command /setspawn:
permission: op
trigger:
set {spawn} to location of player
send "set spawn to: %{spawn}%" to player

command /spawn:
trigger:
send "&bTeleporting you to Spawn in &c&l5 &bseconds."

    set {_cooldown} to 100

    set {_loc} to location of player
    while {_cooldown} is not 0:

        remove 1 from {_cooldown}

        if distance between {_loc} and player is not 0:
            send "&cYou have moved, teleportation cancelled."
            stop

        set {_loc} to location of player
        
        wait a tick

    teleport executor to {spawn}
    send "&bTeleported to Spawn"``
inner sun
#

@terse nebula That counts only if player moves when it happens basically I want it to understand that when the player has moved from block or took damage it will send "" stop

#

I could move alot and then when it 1 second just stop moving and works

terse nebula
#

uh

#

sorry

glad lagoon
#

Then make a combat system and use the variable or what ur gonna use for that and check if its true