script.Parent.DetectionPart.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
local character = hit.Parent
local player = game.Players:GetPlayerFromCharacter(character)
if not player.TeamColor ~= BrickColor.new("Bright red") then
local rope = Instance.new("RopeConstraint", script.Parent)
rope.Color = BrickColor.new("Deep blue")
rope.Thickness = .08
local attachment0 = Instance.new("Attachment", character.Head)
rope.Attachment0 = attachment0
rope.Attachment1 = script.Parent.Shotpart.Attachment1
rope.Visible = true
wait(.2)
character.Humanoid.Health = 0
rope:Destroy()
attachment0:Destroy()
end
end
end)
You may not need the CFrame.Angles depending on what type of part you are using
And set the size of the part to the magnitude between the start and end position
You’re good to go if you use CFrame.lookAt. I believe CFrame.new(start,end) is deprecated, as the documentation site says to use CFrame.lookAt instead.