i have a script that selects a player and forces them to be stuck to where the event player clicks, this works fine, but the problems arise when i attempt to use the script on another player, it will select them fine but when i click on a spot to stick them too, it sticks every other previously selected player along with them
[my code](ht tps://imgur.com/a/0AFnQ6n)
Can you copy paste the entire script? Right next to Import / save settings, the is a copy settings button.
variables
{
global:
28: LeashTarget
player:
26: Post
28: Leashed
29: Spherecast1
}
actions
{
Abort If(Event Player != Host Player);
Global.LeashTarget = Player Closest To Reticle(Event Player, All Teams);
If(Global.LeashTarget.Leashed == False);
Start Forcing Player Outlines(Global.LeashTarget, Event Player, True, Color(Yellow), Always);
Wait Until(Is Button Held(Event Player, Button(Primary Fire)), 99999);
Global.LeashTarget.Spherecast1 = Ray Cast Hit Position(Eye Position(Event Player), Ray Cast Hit Position(Eye Position(
Event Player), Eye Position(Event Player) + Facing Direction Of(Event Player) * 1000, All Players(All Teams), Event Player,
True), All Players(All Teams), Event Player, True);
Create Effect(All Players(All Teams), Sphere, Color(Blue), Global.LeashTarget.Spherecast1, 0.300, None);
Global.LeashTarget.Post = Last Created Entity;
Teleport(Global.LeashTarget, Global.LeashTarget.Spherecast1);
Start Forcing Player Position(Global.LeashTarget, Global.LeashTarget, True);
Global.LeashTarget.Leashed = True;
Else If(Global.LeashTarget.Leashed == True);
Stop Forcing Player Outlines(Global.LeashTarget, Event Player);
Stop Forcing Player Position(Global.LeashTarget);
Global.LeashTarget.Leashed = False;
Destroy Effect(Global.LeashTarget.Post);
}
entire game code: Z91JK
im using a widow 1v1 custom that i found to make my scripts, the script i am having trouble with is called “leash” at the very bottom of workshop scripts