14:22:08.949 ReplicatedStorage.Modules.MainModule:12: attempt to index string with 'Parent' - Server - MainModule:12

Alright, so basically I decided to drop off CollectionService after struggling with it for a long while, and made a Module in which I could add a value and delete it as a simple way of doing stun.

The issue seems to keep occuring in which it attempts to “index string with ‘Parent’”, when the model is an instance aswell.

local MainModule = {}

function MainModule:AddValues(Ins, Value, Name, Duration)
	
	local Values = Instance.new(Value)
	Value.Parent = Ins
	Value.Name = Name
	
	Debris:AddItem(Values, Duration)
end

This is how the module is setup, and how

MM:AddValues(EnemyChar, "BoolValue", "Stun", Length*2) -- This is the line where the error is occuring.

I use the module. The whole thing about this is I used the print function and it printed out the models name, so I’m just left in confusion.

change this with

local Value = Instance.new(Value)
	Value.Parent = Ins
	Value.Name = Name

you just misspelled it. The first value you wrote with “s” at the end