cancel on move or while in combat.

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

Status
Not open for further replies.

ShadowFaite

Member
Jul 2, 2018
19
0
1
is it possible to make this skript cancel if the player moves or is in combat?

code_language.skript:
command /spawn:
    trigger:
        message "&2&l[&2Farmland&2&l]&a&l>> &aDu vil blive teleporteret til spawn om 5 sekunder!"
        wait 20 tick
        message "&2&l[&2Farmland&2&l]&a&l>> &aDu vil blive teleporteret til spawn om 4 sekunder!"
        wait 20 tick
        message "&2&l[&2Farmland&2&l]&a&l>> &aDu vil blive teleporteret til spawn om 3 sekunder!"
        wait 20 tick
        message "&2&l[&2Farmland&2&l]&a&l>> &aDu vil blive teleporteret til spawn om 2 sekunder!"
        wait 20 tick
        message "&2&l[&2Farmland&2&l]&a&l>> &aDu vil blive teleporteret til spawn om 1 sekunder!"
        wait 20 tick
        make console execute command "/espawn %player%"
 
Yes, SkQuery has a “on any movement” event, called whenever a player moves his body, even his head.
code_language.skript:
on any movement:
    cancel event
That would prevent the player from moving at all.
Now, it’s more complicated to do a “is in combat” check, as I believe there is no such condition. You’d have to set a variable to 10 every time a player gets damaged, and subtracting 1 from it every second, so if the variable reaches 0, it sets the variable to false, meaning the player was not in combat for 10 seconds.
 
Yes, SkQuery has a “on any movement” event, called whenever a player moves his body, even his head.
code_language.skript:
on any movement:
    cancel event
That would prevent the player from moving at all.
Now, it’s more complicated to do a “is in combat” check, as I believe there is no such condition. You’d have to set a variable to 10 every time a player gets damaged, and subtracting 1 from it every second, so if the variable reaches 0, it sets the variable to false, meaning the player was not in combat for 10 seconds.
At least let the player move their head lol


CombatTag is not that hard to make in Skript, I made one for my friends server in around 15 minutes.
 
Status
Not open for further replies.