CollarHandler (serverscript): local events =…
- User
CollarHandler (serverscript): local events = game.ReplicatedStorage:WaitForChild("RemoteEvents")
local function GiveCollarGetAttachment(player) local char = player.Character
codelocal g = script.Collar:clone() g.Parent = char local C = g:GetChildren() for i=1, #C do if C[i]:IsA("BasePart") then local W = Instance.new("Weld") W.Part0 = g.Middle W.Part1 = C[i] local CJ = CFrame.new(g.Middle.Position) local C0 = g.Middle.CFrame:inverse() * CJ local C1 = C[i].CFrame:inverse() * CJ W.C0 = C0 W.C1 = C1 W.Parent = g.Middle end local Y = Instance.new("Weld") Y.Part0 = char.Head Y.Part1 = g.Middle Y.C0 = CFrame.new(0, 0, 0) Y.Parent = Y.Part0 end local h = g:GetChildren() for i = 1, #h do if h[i]:IsA("BasePart") then h[i].Anchored = false h[i].CanCollide = false end end return g.AttachmentPart.Attachmentend
local function AddAttachmentToArm(player) local char = player.Character local newAttachment = Instance.new("Attachment") newAttachment.Position = Vector3.new(0, -1, 0) newAttachment.Parent = char["Right Arm"]
codereturn newAttachmentend
local function MakeLeash(Attachment0, Attachment1) local newRopeRenderer = script.RopeRenderer:Clone() newRopeRenderer.DrawLocalLine.Attachment0.Value = Attachment0 newRopeRenderer.DrawLocalLine.Attachment1.Value = Attachment1 newRopeRenderer.Parent = workspace newRopeRenderer.Enabled = true
codereturn newRopeRendererend
local function AddPlayerController(victim, owner) local newPlayerController = script.PlayerController:Clone() newPlayerController.Owner.Value = owner.Character newPlayerController.Parent = victim.PlayerGui newPlayerController.Enabled = true end
local function AddCollarRemover(victim, owner) local newRemover = script.CollarRemover:Clone() newRemover.Victim.Value = victim newRemover.Owner.Value = owner newRemover.Parent = workspace newRemover.Enabled = true end
local function MakeCollar(owner, victim) local attachment0 = GiveCollarGetAttachment(victim) local attachment1 = AddAttachmentToArm(owner) local newRope = MakeLeash(attachment0, attachment1)
- Assistant