This script is supposed to make a rope between the person who shoots the projectile, and the body part of whoever it hits. But it keeps telling me " attempt to index field 'Attachment0' (a nil value)"
Character = script.Parent.Parent.Parent
function touch(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid and humanoid.Parent.Name ~= script.Parent.Parent.Parent.Name then
local wire = Instance.new("RopeConstraint")
wire.Parent = Character.UpperTorso
wire.Attachment0.Parent = Character.UpperTorso
wire.Attachment1.Parent = hit
wire.Length = 100
end
end
script.Parent.Touched:connect(touch)

2 comments
Thanks. But now it says "bad cast".
Yeah make sure you are attaching them to actual attachments not the base part itself