Player switch position

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

SL1CE

Member
Mar 31, 2019
2
0
0
23
Category:
PvP
Suggested name:
Switcher
Spigot/Skript Version:
Spigot 1.8.8
What I want:
I need skript for Kit PvP class. Player will have for example snowball in his hand and when he will shoot someone with this snowball, it will automatically switch position with that player. There will be also cooldown for 16 seconds.
Ideas for commands:
Command for giving me that snowball.
Ideas for permissions:
It's up to you (for example snowball.give)
When I'd like it by: 2 weeks
 
You're not getting the code in two weeks, you're getting it now. (This code is untested).

Code:
on right click with a snowball:
    name of player's tool is "&5&lSwap!"
    {swap.cooldown::%player%} isn't true
    set {swap.cooldown::%player%} to true
    shoot a snowball from player
    wait 16 seconds
    set {swap.cooldown::%player%} to false
on damage:
    projectile exists
    projectile is a snowball
    name of attacker's tool is "&5&lSwap!"
    set {_this} to victim's location
    set {_that} to attacker's location
    teleport victim to {_that}
    teleport attacker to {_this}
Have fun!
 
You're not getting the code in two weeks, you're getting it now. (This code is untested).

Code:
on right click with a snowball:
    name of player's tool is "&5&lSwap!"
    {swap.cooldown::%player%} isn't true
    set {swap.cooldown::%player%} to true
    shoot a snowball from player
    wait 16 seconds
    set {swap.cooldown::%player%} to false
on damage:
    projectile exists
    projectile is a snowball
    name of attacker's tool is "&5&lSwap!"
    set {_this} to victim's location
    set {_that} to attacker's location
    teleport victim to {_that}
    teleport attacker to {_this}
Have fun!
Thank you, I'll try it ASAP!