So, I'm okay at scripting not the best. This is a re-post because my other anwsers just didn't work. Anyways here's the script I need help with.
local playerModel = script.Parent
local humanoid = playerModel:WaitForChild("Humanoid")
local userInputService = game:GetService("UserInputService")
local partA = playerModel.HumanoidRootPart
local attachmentA = Instance.new("Attachment",partA)
local attachmentAPos = attachmentA.Position
attachmentAPos = Vector3.new(0,0,-1)
local partB = script.Parent.RightHand
local attachmentB = Instance.new("Attachment",partB)
local attachmentBPos = attachmentB.Position
attachmentBPos = Vector3.new(0,0,-1)
humanoid(function(player) player.CharacterAdded:Connect(function(character) character:WaitForChild("Humanoid").Died:Connect(function() if humanoid.Health >= 0 then local distance = (partA.Position - partB.Position).magnitude
if distance == 10 then
userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if input.UserInputType == Enum.UserInputType.Keyboard then if input.InputKeycode == Enum.KeyCode.E then local rodConstraint = Instance.new("RodConstraint",partA) rodConstraint .Attachment0 = attachmentA rodConstraint .Attachment1 = attachmentB
end
end
end)
end
end
end)
end)
end)
It says Workspace.darkkitten12345.LocalScript:15: attempt to call a Instance value. I REALLY need help on this, thank you.

1 comment
Alright, thanks! I'll message you.