--[[
    Utility function to create an instance of the given instanceName
    setting its parent after its properties have been set
]]

return function(instanceName, parent, properties)
	local instance = Instance.new(instanceName)

	for propertyName, value in pairs(properties or {}) do
		instance[propertyName] = value
	end

	instance.Parent = parent

	return instance
end
