The value is in the SwordCarrier script and that value shows the name of the sword.
In this script, i want it to check the sword name in the values input and if that input is in the NPC
then when the NPC dies delete the sword by checking trough the value
ERROR: SwordName is not a valid member of Model
npc = script.Parent:Clone()
SwordName = script.Parent.SwordCarrier.SwordName
function Died()
print('nope')
if script.Parent.SwordCarrier.SwordName.Value ~= nil then
script.Parent.SwordName.Value:Destroy()
wait(5)
npc.Parent = script.Parent.Parent
npc:MakeJoints()
npc.Human.Health = npc.Human.MaxHealth
script.Parent:Destroy()
end
end
script.Parent.Human.Died:connect(Died)
