My goal here is to make a handcuff system, where when the officer clicks a suspect, the suspect teleports to his hands hand he is sort of welded to the officer and has no control. My problem is that when I try to teleport the suspect to the officer with the offset script I've already made, it sometimes goes behind the officer instead of where I want him to go, which is in the front to the side a bit.
any help would be appreciated.
(first local script)
local tool = script.Parent
local players = game:GetService("Players")
tool.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
if mouse.Target and mouse.Target.Parent then
if mouse.Target.Parent:FindFirstChild("Humanoid") then
game:GetService("ReplicatedStorage"):WaitForChild("ArrestGrab"):FireServer(mouse.Target.Parent)
end
end
end)
end)
(Second script from server)
game:GetService("ReplicatedStorage"):WaitForChild("ArrestGrab").OnServerEvent:Connect(function(officer,suspect)
if suspect.Settings.inCuffs.Value ~= true then
local officerChar = officer.Character
local a,b,c = officerChar.HumanoidRootPart.Position.X-1.5,officerChar.HumanoidRootPart.Position.Y,officerChar.HumanoidRootPart.Position.Z+1.5
suspect.HumanoidRootPart.Position = Vector3.new(a,b,c)
officerChar.HumanoidRootPart.Orientation = suspect.HumanoidRootPart.Orientation
suspect:WaitForChild("Humanoid"):LoadAnimation(game:GetService("ServerStorage"):WaitForChild("Grab")):Play()
suspect:WaitForChild("Humanoid"):LoadAnimation(game:GetService("ServerStorage"):WaitForChild("Arrest")):Play()
end
end)
(please ignore the un-used functions and such, I removed those bits to give a better understanding of what the actual problem is)

1 comment
o