Leash players

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

Shroomz

Supporter +
Jun 22, 2017
44
0
6
25
How I can make players attached to leash like horses. They could not run away and they would be forced to "follow" the player that leashed them. They could by shifting (sneaking) avoid this leash operation.
[doublepost=1499461642,1499110987][/doublepost]I still need help with this? How I can attach players with leash
 
How I can make players attached to leash like horses. They could not run away and they would be forced to "follow" the player that leashed them. They could by shifting (sneaking) avoid this leash operation.
[doublepost=1499461642,1499110987][/doublepost]I still need help with this? How I can attach players with leash
You cannot attach player to a leash.
 
@Scarlet While leashing a player with a physical leash is not possible, you can probably simulate its effects.

This may work. It may also make people into human tether balls.

code_language.skript:
command /leash [<text="on">]:
    trigger:
        arg 1 is "on":
            target entity is a player
            set {leashed::%uuid of target entity%} to player
            set {leasher::%uuid of player%} to target entity
        arg 1 is "off":
            loop {leashed::*}:
                loop-value is player
                delete {leashed::%loop-index%}
                delete {leasher::%uuid of player%}
       
on any movement:
    if {leashed::%uuid of player%} is set:
        distance between location of player and location of {leashed::%uuid of player%} is greater than 5
        set {_direction} to vector between location of player and location of {leashed::%uuid of player%}
        push player {_direction} at speed 0.5
    else if {leasher::%uuid of player%} is set:
        distance between location of player and location of {leasher::%uuid of player%} is greater than 5
        set {_direction} to vector between location of {leasher::%uuid of player%} and location of player
        push {leasher::%uuid of player%} {_direction} at speed 0.5

I was planning on making a function called vectorPush, but it ended up not liking "location of {leashed::%uuid of player%}" as a location argument, so I decided against it. If the actual code used more lines of code, I would go out of my way to rearrange some things to get the function to work, but it's only 3 lines and I'm lazy
[doublepost=1499465083,1499463960][/doublepost]And it you actually wanted to, you could spawn an invisible, silent, non-AI, leash-able entity to attach a physical leash to, and just have that entity be close to the leashed player.
 
I have seen it on one server. It was not physically attached like horses but they followed the user who had leash in their hand after they clicked their "victim"
Its possible but it would be kinda annoying to make and really suck for people with high ping
 
Status
Not open for further replies.