#Spawn with on move cancel

1 messages · Page 1 of 1 (latest)

zealous talon
#

check if their position is still the same (or within a radius) before teleporting

charred light
#

how?

charred light
# charred light how?

Set the block underneath the player and check if the player isn't on the block anymore

zealous talon
#

when doing the command save position in a variable and check the distance and cancel if it's too far

charred light
#
        send "Canceling teleport to spawn."
        stop```
zealous talon
#

i would probably do like 0.2 so tiny movements don't cancel it

#

distance between {_loc} and player > 0.2

charred light
#
    cooldown: 3 seconds
    cooldown message: &cYou are using this command to much, slow down!
    trigger:
        message "&7Teleporting in 5 seconds. Dont move!"
        wait 5 second
        teleport player to {spawn}
        message "&7Teleported you to spawn."

command /setspawn:
    permission: spawn.set
    trigger:
        set {spawn} to player's location

on join:
    wait 2 ticks
    teleport player to {spawn}

on respawn:
    teleport player to {spawn}
distance between {_loc} and player > 0.2```
#

how to I format

zealous talon
#

🤨

charred light
#

idk what to do D:

#

Well you'll need a countdown, then in the countdown check if the player isn't on the block

#

HOw

#

if i knew what to do I wouldnt have made this

zealous talon
#
command /spawn:
    cooldown: 3 seconds
    cooldown message: &cYou are using this command to much, slow down!
    trigger:
        set {_loc} to player's location
        message "&7Teleporting in 5 seconds. Dont move!"
        wait 5 second
        if distance between {_loc} and player's location > 0.2:
          send "&cYou moved, teleport cancelled"
          stop
        teleport player to {spawn}
        message "&7Teleported you to spawn."```
sweet field
#

you could use a while loop so it instantly cancels the teleport when they move rather than waiting 5 seconds to check

charred light
#

It doent show if its cancelled until the teleport happens

#

Ohh

#

how do I loop?

sweet field
#

or just loop like 5 times and in the loop, wait 1 second and check for the location like above

charred light
#

what do i type?

#

to do that

charred light
#

No you didnt

#

I dont know what I am doing with loops

#

why are people in minehut like this bro

#

they expect you to know everything

runic pilot
#

do you know how to make a loop?

charred light
#

No I said that

#

No

runic pilot
#

!docs

chrome perchBOT
#

Skript Documentation

Skript documentation, sometimes referred to as "the docs" are a great resource for beginners learning skript or experts reviewing a topic. They hold a wide variety of information on various events, conditions, effects, and expressions. Here’s a few popular documentation websites:

Skript Lang Github
Skript Hub Docs
skUnity Docs
Bukkit Dev
skUnity Parser - Another great tool is the skunity parser, which can parse (run) your skript code in a web browser and check for errors!

charred light
#

loop all players:

runic pilot
#

why you looping all players

charred light
#

IDK WHAT TO DO

#

I have said this

#

I litterly dont know what to do

runic pilot
#

tarna told you

charred light
#

cant understand event loop 5 times

runic pilot
#

event?

#

why would that be an event

charred light
#

It's not an event my guy

runic pilot
#

exactly

charred light
#

I DONT KNOW WHAT I AM DOing

#

how many times do I have to say this

runic pilot
#

learn skript basics...

charred light
#

you just give me this bunch of words and expect me to know where to put it

runic pilot
#

thats why you learn skript basics

charred light
#

It doesnt work

#

no errors

runic pilot
#

??

#

what doesn't work

charred light
#

idk you tell me

runic pilot
#

how am i suppose to tell you if you dont show me what you did?

charred light
#
    cooldown: 3 seconds
    cooldown message: &cYou are using this command to much, slow down!
    trigger:
        set {_loc} to player's location
        message "&7Teleporting in 5 seconds. Dont move!"
        loop 5 times:
        wait 5 second
        if distance between {_loc} and player's location > 0.2:
            send "&cYou moved, teleport cancelled!"
            stop
        teleport player to {spawn}
        message "&7Teleported you to spawn."

command /setspawn:
    permission: spawn.set
    trigger:
        set {spawn} to player's location

on join:
    wait 2 ticks
    teleport player to {spawn}

on respawn:
    teleport player to {spawn}```
runic pilot
#

well u need to indent

charred light
#

indentation wrong!

runic pilot
#

also that wont do jack

charred light
#

whats wrong with indent

#

where do I put it then

runic pilot
#

do you know what a indent is

charred light
#

Yes omg

runic pilot
#

then put it

runic pilot
#

if u dont want to read the tutorials

#

how you gonna fix it

charred light
runic pilot
#

got any idea on serialization of an array in java? mr tesco

charred light
#

Maybe if you guys accually helped I would be done

runic pilot
#

we are

charred light
#

Not at all

#

if you were helping you would be helping

runic pilot
#

💀

charred light
runic pilot
#

i gotta do it to save stuff lol

#

my brain is getting fried

charred light
#

I can't even say the sentence out loud for gods sake!

charred light
#

Not at all

#

Those websites dont help

#

They do, they show you how to actually do the stuff the right way

#

No

#

Do you expect us to spoonfeed you or something? If you don't want to deal with the hassle then get a Developer to make it for you in #job-board

charred light
#

Totally 😉

#

Mhm

#

Its very very true

#

I'm not saying that it isn't true

rancid gazelle
hallow shale
#

just spoonfeed him at this point bro

charred light
#
  trigger:
    set {spawntp::%player%} to true
    wait 7 seconds
    if {spawntp::%player%} exists:
      execute console command "tp %Player% -848 63 -836"
      delete {spawntp::%player%}
    else:
      send "&cYou Moved! Could not TP."
   

on player move:
  {spawntp::%player%} exists:
    delete {spawntp::%player%}
#

might not work just coded it on discord.

vernal heath
chrome perchBOT
#

minehut Spoonfeeding

When helping other players, please refrain from spoon-feeding the information. This is where you give someone the solution without letting them figure it out and learn from their mistakes. It might solve their issue but it won’t allow them to learn how to fix it in the future.

Instead, you should work with them and help them learn to figure out the solution on their own.

vernal heath
charred light
vernal heath
#

thats how i learned

charred light
#

💀

vernal heath
#

i got spoonfeeded a tiny bit but then i got told about docs

#

and now my life has changed for the better cause spoonfeed = bad

rancid gazelle
#
  trigger:
    set {spawn::%player%} to true
    wait 7 seconds
    if {spawn::%player%} exists:
      teleport player to {spawn}
      delete {spawn::%player%}
   

on player move:
  {spawn::%player%} exists:
    delete {spawn::%player%}
    send "&cYou Moved! Could not TP."```

Do this its what @charred light said but the send will be faster (cause its in the on player move function)